Ticket #11791: 0002-extend-IPTV-hack-to-handle-PAT-with-two-entries-but-.patch

File 0002-extend-IPTV-hack-to-handle-PAT-with-two-entries-but-.patch, 1.8 KB (added by Karl Egly, 7 years ago)

draft patch

  • mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp

    From 7cb4658d4d1549d9416e3f3a0893509c28121b85 Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@mythtv.org>
    Date: Thu, 29 Aug 2013 23:00:14 +0200
    Subject: [PATCH 2/2] extend IPTV hack to handle PAT with two entries but only
     one program
    
    Refs #11791
    ---
     .../libs/libmythtv/recorders/dtvsignalmonitor.cpp  |   11 +++++++++++
     1 file changed, 11 insertions(+)
    
    diff --git a/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp b/mythtv/libs/libmythtv/recorders/dtvsignalmonitor.cpp
    index f3e4b6b..7a0917d 100644
    a b void DTVSignalMonitor::HandlePAT(const ProgramAssociationTable *pat) 
    321321                .arg(programNumber);
    322322            LOG(VB_GENERAL, LOG_ERR, LOC + errStr + "\n" + pat->toString());
    323323        }
     324        // only one entry in the PAT, just use it
    324325        if (pat->ProgramCount() == 1)
    325326        {
    326327            LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
    void DTVSignalMonitor::HandlePAT(const ProgramAssociationTable *pat) 
    329330            AddFlags(kDTVSigMon_PATMatch);
    330331            GetStreamData()->AddListeningPID(pat->ProgramPID(0));
    331332        }
     333        // two entries, but one is a pointer to the NID PID instead of a real program, use the other
     334        if ((pat->ProgramCount() == 2) && ((pat->ProgramNumber(0) == 0) || (pat->ProgramNumber(1) == 0)))
     335        {
     336            LOG(VB_GENERAL, LOG_ERR, LOC + "But there is only one program "
     337                                           "in the PAT, so we'll just use it");
     338            uint pid = pat->FindAnyPID();
     339            SetProgramNumber(pat->FindProgram(pid));
     340            AddFlags(kDTVSigMon_PATMatch);
     341            GetStreamData()->AddListeningPID(pid);
     342        }
    332343    }
    333344}
    334345