Cache AAC pid in lamedb
authorAthanasios Oikonomou <athoik@gmail.com>
Tue, 5 May 2015 15:18:39 +0000 (18:18 +0300)
committerlittlesat <littlesat99@yahoo.com>
Wed, 6 May 2015 13:53:48 +0000 (15:53 +0200)
Signed-off-by: littlesat <littlesat99@yahoo.com>

lib/dvb/idvb.h
lib/dvb/pmt.cpp
lib/service/servicedvb.cpp

index d5575ac..5c28e7a 100644 (file)
@@ -275,7 +275,7 @@ public:
        {
                cVPID, cMPEGAPID, cTPID, cPCRPID, cAC3PID,
                cVTYPE, cACHANNEL, cAC3DELAY, cPCMDELAY,
-               cSUBTITLE, cAACHEAPID=12, cDDPPID, cacheMax
+               cSUBTITLE, cAACHEAPID=12, cDDPPID, cAACAPID, cacheMax
        };
 
        int getCacheEntry(cacheID);
index ceddf0a..b6f71ba 100644 (file)
@@ -360,6 +360,7 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
        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;
@@ -380,6 +381,7 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                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);
        }
 
@@ -392,6 +394,7 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                int autoaudio_ac3 = -1;
                int autoaudio_ddp = -1;
                int autoaudio_aache = -1;
+               int autoaudio_aac = -1;
                int autoaudio_level = 4;
 
                std::string configvalue;
@@ -454,7 +457,8 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                        if (program.audioStreams[i].pid == cached_apid_ac3
                         || program.audioStreams[i].pid == cached_apid_ddp
                         || program.audioStreams[i].pid == cached_apid_mpeg
-                        || program.audioStreams[i].pid == cached_apid_aache)
+                        || program.audioStreams[i].pid == cached_apid_aache
+                        || program.audioStreams[i].pid == cached_apid_aac)
                        {
                                /* if we find the cached pids, this will be our default stream */
                                audio_cached = i;
@@ -463,7 +467,8 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                        if ((program.audioStreams[i].type != audioStream::atMPEG) && ((first_non_mpeg == -1)
                                || (program.audioStreams[i].pid == cached_apid_ac3)
                                || (program.audioStreams[i].pid == cached_apid_ddp)
-                               || (program.audioStreams[i].pid == cached_apid_aache)))
+                               || (program.audioStreams[i].pid == cached_apid_aache)
+                               || (program.audioStreams[i].pid == cached_apid_aac)))
                        {
                                first_non_mpeg = i;
                        }
@@ -482,6 +487,8 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                                                        autoaudio_ddp = i;
                                                else if (program.audioStreams[i].type == audioStream::atAACHE && (autoaudio_level > x || autoaudio_aache == -1))
                                                        autoaudio_aache = i;
+                                               else if (program.audioStreams[i].type == audioStream::atAAC && (autoaudio_level > x || autoaudio_aac == -1))
+                                                       autoaudio_aac = i;
                                                autoaudio_level = x;
                                                break;
                                        }
@@ -540,6 +547,8 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                                program.defaultAudioStream = autoaudio_ddp;
                        else if (autoaudio_aache != -1)
                                program.defaultAudioStream = autoaudio_aache;
+                       else if (autoaudio_aac != -1)
+                               program.defaultAudioStream = autoaudio_aac;
                        else if (first_non_mpeg != -1)
                                program.defaultAudioStream = first_non_mpeg;
                }
@@ -626,6 +635,15 @@ int eDVBServicePMTHandler::getProgramInfo(program &program)
                        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 29f7975..9c9a560 100644 (file)
@@ -1979,6 +1979,9 @@ int eDVBServicePlay::getInfo(int w)
                        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:
@@ -2206,12 +2209,14 @@ int eDVBServicePlay::selectAudioStream(int i)
                || ((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::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();