Ticket #10207: 0001-Use-PSIPTable-instead-of-PESPacket-to-get-correct-Ha.patch

File 0001-Use-PSIPTable-instead-of-PESPacket-to-get-correct-Ha.patch, 3.9 KB (added by dekarl@…, 8 years ago)
  • mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp

    From 79fb7cec4f79aea770cc37ebb44b23e6777a3b9b Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@users.sourceforge.net>
    Date: Wed, 14 Dec 2011 19:04:13 +0100
    Subject: [PATCH] Use PSIPTable instead of PESPacket to get correct HasCRC() implementation
    
    ---
     mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp |   12 ++++++------
     mythtv/libs/libmythtv/mpeg/mpegstreamdata.h   |    6 +++---
     2 files changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
    index 21d5f2f..c8a0c69 100644
    a b PSIPTable* MPEGStreamData::AssemblePSIP(const TSPacket* tspacket, 
    256256    bool broken = true;
    257257    moreTablePackets = true;
    258258
    259     PESPacket* partial = GetPartialPES(tspacket->PID());
     259    PSIPTable* partial = GetPartialPES(tspacket->PID());
    260260    if (partial && partial->AddTSPacket(tspacket, broken) && !broken)
    261261    {
    262262        // check if it's safe to read pespacket's Length()
    PSIPTable* MPEGStreamData::AssemblePSIP(const TSPacket* tspacket, 
    304304                {
    305305                    // Saving will handle deleting the old one
    306306                    SavePartialPES(tspacket->PID(),
    307                                    new PESPacket(*tspacket));
     307                                   new PSIPTable(*tspacket));
    308308                }
    309309                else
    310310#endif
    PSIPTable* MPEGStreamData::AssemblePSIP(const TSPacket* tspacket, 
    364364    const int pes_length = (pesdata[2] & 0x0f) << 8 | pesdata[3];
    365365    if ((pes_length + offset + extra_offset) > 188)
    366366    {
    367         SavePartialPES(tspacket->PID(), new PESPacket(*tspacket));
     367        SavePartialPES(tspacket->PID(), new PSIPTable(*tspacket));
    368368        moreTablePackets = false;
    369369        return 0;
    370370    }
    PSIPTable* MPEGStreamData::AssemblePSIP(const TSPacket* tspacket, 
    377377    if ((offset + psip->SectionLength() < TSPacket::kSize) &&
    378378        (pesdata[psip->SectionLength() + 1] != 0xff))
    379379    {
    380         // This isn't sutffing, so we need to put this
     380        // This isn't stuffing, so we need to put this
    381381        // on as a partial packet.
    382         PESPacket *pesp = new PESPacket(*tspacket);
     382        PSIPTable *pesp = new PSIPTable(*tspacket);
    383383        pesp->SetPSIOffset(offset + psip->SectionLength());
    384384        SavePartialPES(tspacket->PID(), pesp);
    385385        return psip;
    PIDPriority MPEGStreamData::GetPIDPriority(uint pid) const 
    11331133    return kPIDPriorityNone;
    11341134}
    11351135
    1136 void MPEGStreamData::SavePartialPES(uint pid, PESPacket* packet)
     1136void MPEGStreamData::SavePartialPES(uint pid, PSIPTable* packet)
    11371137{
    11381138    pid_pes_map_t::iterator it = _partial_pes_packet_cache.find(pid);
    11391139    if (it == _partial_pes_packet_cache.end())
  • mythtv/libs/libmythtv/mpeg/mpegstreamdata.h

    diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.h
    index 0c4e0e9..f4c666d 100644
    a b class PESPacket; 
    2626
    2727typedef vector<uint>                    uint_vec_t;
    2828
    29 typedef QMap<unsigned int, PESPacket*>  pid_pes_map_t;
     29typedef QMap<unsigned int, PSIPTable*>  pid_pes_map_t;
    3030typedef QMap<const PSIPTable*, int>     psip_refcnt_map_t;
    3131
    3232typedef ProgramAssociationTable*               pat_ptr_t;
    class MTV_PUBLIC MPEGStreamData : public EITSource 
    293293    // Table processing -- for internal use
    294294    PSIPTable* AssemblePSIP(const TSPacket* tspacket, bool& moreTablePackets);
    295295    bool AssemblePSIP(PSIPTable& psip, TSPacket* tspacket);
    296     void SavePartialPES(uint pid, PESPacket* packet);
    297     PESPacket* GetPartialPES(uint pid)
     296    void SavePartialPES(uint pid, PSIPTable* packet);
     297    PSIPTable* GetPartialPES(uint pid)
    298298        { return _partial_pes_packet_cache[pid]; }
    299299    void ClearPartialPES(uint pid)
    300300        { _partial_pes_packet_cache.remove(pid); }