Cache ddp/aac/he-aac pid in lamedb
authorsmlee <smlee@dev3>
Fri, 26 Feb 2016 08:04:33 +0000 (17:04 +0900)
committersmlee <smlee@dev3>
Fri, 26 Feb 2016 08:04:33 +0000 (17:04 +0900)
lib/dvb/idvb.h
lib/dvb/pmt.cpp
lib/service/servicedvb.cpp

index 3dd3481..2c11ff8 100644 (file)
@@ -277,9 +277,9 @@ class eDVBService: public iStaticServiceInformation
 public:
        enum cacheID
        {
-               cVPID, cAPID, cTPID, cPCRPID, cAC3PID,
+               cVPID, cMPEGAPID, cTPID, cPCRPID, cAC3PID,
                cVTYPE, cACHANNEL, cAC3DELAY, cPCMDELAY,
-               cSUBTITLE, cacheMax
+               cSUBTITLE, cAACHEAPID=12, cDDPPID, cAACAPID, cacheMax
        };
 
        int getCacheEntry(cacheID);
index 6f0c9ee..b3e8aeb 100644 (file)
@@ -490,7 +490,10 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
 {
        ePtr<eTable<ProgramMapSection> > ptr;
        int cached_apid_ac3 = -1;
+       int cached_apid_ddp = -1;
        int cached_apid_mpeg = -1;
+       int cached_apid_aache = -1;
+       int cached_apid_aac = -1;
        int cached_vpid = -1;
        int cached_tpid = -1;
        int ret = -1;
@@ -509,8 +512,11 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
        if ( m_service && !m_service->cacheEmpty() )
        {
                cached_vpid = m_service->getCacheEntry(eDVBService::cVPID);
-               cached_apid_mpeg = m_service->getCacheEntry(eDVBService::cAPID);
+               cached_apid_mpeg = m_service->getCacheEntry(eDVBService::cMPEGAPID);
                cached_apid_ac3 = m_service->getCacheEntry(eDVBService::cAC3PID);
+               cached_apid_ddp = m_service->getCacheEntry(eDVBService::cDDPPID);
+               cached_apid_aache = m_service->getCacheEntry(eDVBService::cAACHEAPID);
+               cached_apid_aac = m_service->getCacheEntry(eDVBService::cAACAPID);
                cached_tpid = m_service->getCacheEntry(eDVBService::cTPID);
        }
 
@@ -912,11 +918,11 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                                                audio.pid = (*es)->getPid();
 
                                                        /* if we find the cached pids, this will be our default stream */
-                                               if (audio.pid == cached_apid_ac3 || audio.pid == cached_apid_mpeg)
+                                               if (audio.pid == cached_apid_ac3 || audio.pid == cached_apid_ddp || audio.pid == cached_apid_mpeg || audio.pid == cached_apid_aache || audio.pid == cached_apid_aac)
                                                        program.defaultAudioStream = program.audioStreams.size();
 
                                                        /* also, we need to know the first non-mpeg (i.e. "ac3"/dts/...) stream */
-                                               if ((audio.type != audioStream::atMPEG) && ((first_ac3 == -1) || (audio.pid == cached_apid_ac3)))
+                                               if ((audio.type != audioStream::atMPEG) && ((first_ac3 == -1) || (audio.pid == cached_apid_ac3) || (audio.pid == cached_apid_ddp)))
                                                        first_ac3 = program.audioStreams.size();
 
                                                program.audioStreams.push_back(audio);
@@ -968,6 +974,33 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                        program.audioStreams.push_back(s);
                        ++cnt;
                }
+               if ( cached_apid_ddp != -1 )
+               {
+                       audioStream s;
+                       s.type = audioStream::atDDP;
+                       s.pid = cached_apid_ddp;
+                       s.rdsPid = -1;
+                       program.audioStreams.push_back(s);
+                       ++cnt;
+               }
+               if ( cached_apid_aache != -1 )
+               {
+                       audioStream s;
+                       s.type = audioStream::atAACHE;
+                       s.pid = cached_apid_aache;
+                       s.rdsPid = -1;
+                       program.audioStreams.push_back(s);
+                       ++cnt;
+               }
+               if ( cached_apid_aac != -1 )
+               {
+                       audioStream s;
+                       s.type = audioStream::atAAC;
+                       s.pid = cached_apid_aac;
+                       s.rdsPid = -1;
+                       program.audioStreams.push_back(s);
+                       ++cnt;
+               }
                if ( cached_apid_mpeg != -1 )
                {
                        audioStream s;
index d3c6032..07827ec 100755 (executable)
@@ -1729,12 +1729,21 @@ int eDVBServicePlay::getInfo(int w)
        case sAudioPID:
                if (m_dvb_service)
                {
-                       int apid = m_dvb_service->getCacheEntry(eDVBService::cAPID);
+                       int apid = m_dvb_service->getCacheEntry(eDVBService::cMPEGAPID);
                        if (apid != -1)
                                return apid;
                        apid = m_dvb_service->getCacheEntry(eDVBService::cAC3PID);
                        if (apid != -1)
                                return apid;
+                       apid = m_dvb_service->getCacheEntry(eDVBService::cDDPPID);
+                       if (apid != -1)
+                               return apid;
+                       apid = m_dvb_service->getCacheEntry(eDVBService::cAACHEAPID);
+                       if (apid != -1)
+                               return apid;
+                       apid = m_dvb_service->getCacheEntry(eDVBService::cAACAPID);
+                       if (apid != -1)
+                               return apid;
                }
                if (no_program_info) return -1; if (program.audioStreams.empty()) return -1; return program.audioStreams[0].pid;
        case sPCRPID:
@@ -1966,23 +1975,17 @@ int eDVBServicePlay::selectAudioStream(int i)
                                    case the real default is not yet available.)
                        */
        if (m_dvb_service && ((i != -1)
-               || ((m_dvb_service->getCacheEntry(eDVBService::cAPID) == -1) && (m_dvb_service->getCacheEntry(eDVBService::cAC3PID)==-1))))
-       {
-               if (apidtype == eDVBAudio::aMPEG)
-               {
-                       m_dvb_service->setCacheEntry(eDVBService::cAPID, apid);
-                       m_dvb_service->setCacheEntry(eDVBService::cAC3PID, -1);
-               }
-               else if (apidtype == eDVBAudio::aAC3)
-               {
-                       m_dvb_service->setCacheEntry(eDVBService::cAPID, -1);
-                       m_dvb_service->setCacheEntry(eDVBService::cAC3PID, apid);
-               }
-               else
-               {
-                       m_dvb_service->setCacheEntry(eDVBService::cAPID, -1);
-                       m_dvb_service->setCacheEntry(eDVBService::cAC3PID, -1);
-               }
+               || ((m_dvb_service->getCacheEntry(eDVBService::cMPEGAPID) == -1)
+               && (m_dvb_service->getCacheEntry(eDVBService::cAC3PID)==-1)
+               && (m_dvb_service->getCacheEntry(eDVBService::cDDPPID)==-1)
+               && (m_dvb_service->getCacheEntry(eDVBService::cAACHEAPID)==-1)
+               && (m_dvb_service->getCacheEntry(eDVBService::cAACAPID)==-1))))
+       {
+               m_dvb_service->setCacheEntry(eDVBService::cMPEGAPID, apidtype == eDVBAudio::aMPEG ? apid : -1);
+               m_dvb_service->setCacheEntry(eDVBService::cAC3PID, apidtype == eDVBAudio::aAC3 ? apid : -1);
+               m_dvb_service->setCacheEntry(eDVBService::cDDPPID, apidtype == eDVBAudio::aDDP ? apid : -1);
+               m_dvb_service->setCacheEntry(eDVBService::cAACHEAPID, apidtype == eDVBAudio::aAACHE ? apid : -1);
+               m_dvb_service->setCacheEntry(eDVBService::cAACAPID, apidtype == eDVBAudio::aAAC ? apid : -1);
        }
 
        h.resetCachedProgram();