stop PAT parsing after first valid entry for the given SID
authorghost <andreas.monzner@multimedia-labs.de>
Sat, 30 Oct 2010 11:14:17 +0000 (13:14 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Sat, 30 Oct 2010 11:16:04 +0000 (13:16 +0200)
lib/dvb/pmt.cpp

index ee89a3a..ea4b96c 100644 (file)
@@ -133,11 +133,11 @@ void eDVBServicePMTHandler::PATready(int)
        {
                int pmtpid = -1;
                std::vector<ProgramAssociationSection*>::const_iterator i;
        {
                int pmtpid = -1;
                std::vector<ProgramAssociationSection*>::const_iterator i;
-               for (i = ptr->getSections().begin(); i != ptr->getSections().end(); ++i)
+               for (i = ptr->getSections().begin(); pmtpid == -1 && i != ptr->getSections().end(); ++i)
                {
                        const ProgramAssociationSection &pat = **i;
                        ProgramAssociationConstIterator program;
                {
                        const ProgramAssociationSection &pat = **i;
                        ProgramAssociationConstIterator program;
-                       for (program = pat.getPrograms()->begin(); program != pat.getPrograms()->end(); ++program)
+                       for (program = pat.getPrograms()->begin(); pmtpid == -1 && program != pat.getPrograms()->end(); ++program)
                                if (eServiceID((*program)->getProgramNumber()) == m_reference.getServiceID())
                                        pmtpid = (*program)->getProgramMapPid();
                }
                                if (eServiceID((*program)->getProgramNumber()) == m_reference.getServiceID())
                                        pmtpid = (*program)->getProgramMapPid();
                }