Ticket #2664: 2664-v1.patch
File 2664-v1.patch, 3.4 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/mpeg/mpegstreamdata.cpp
692 692 DONE_WITH_PES_PACKET(); // already parsed this table, toss it. 693 693 } 694 694 695 HandleTables(tspacket->PID(), *psip); 695 if (psip->VerifyPSIP(!_have_CRC_bug)) 696 HandleTables(tspacket->PID(), *psip); 697 696 698 DONE_WITH_PES_PACKET(); 697 699 } 698 700 #undef DONE_WITH_PES_PACKET -
libs/libmythtv/mpeg/mpegtables.h
359 359 // only for real ATSC PSIP tables, not similar MPEG2 tables 360 360 void SetProtocolVersion(int ver) { pesdata()[8] = ver; } 361 361 362 const bool VerifyPSIP(bool verify_crc) const; 363 362 364 const QString toString(void) const; 363 365 364 366 static const uint PSIP_OFFSET = 8; // general PSIP header offset -
libs/libmythtv/mpeg/mpegtables.cpp
66 66 return stream_id; 67 67 } 68 68 69 const bool PSIPTable::VerifyPSIP(bool verify_crc) const 70 { 71 if (verify_crc && (CalcCRC() != CRC())) 72 { 73 VERBOSE(VB_SIPARSER, 74 QString("PSIPTable: Failed CRC check 0x%1 != 0x%2 " 75 "for StreamID = 0x%3") 76 .arg(CRC(),0,16).arg(CalcCRC(),0,16).arg(StreamID(),0,16)); 77 return false; 78 } 79 80 unsigned char *bufend = _fullbuffer + _allocSize; 81 82 if ((_pesdata + 2) >= bufend) 83 return false; // can't query length 84 85 if (psipdata() >= bufend) 86 return false; // data outside buffer 87 88 if (TableID::PAT == TableID()) 89 { 90 uint pcnt = (SectionLength() - PSIP_OFFSET - 2) >> 2; 91 return (psipdata() + (pcnt << 2) + 3 < bufend); 92 } 93 94 if (TableID::PMT == TableID()) 95 { 96 if (psipdata() + 3 >= bufend) 97 return false; // can't query program info length 98 99 ProgramMapTable pmt(*this); 100 if ((pmt.ProgramInfo() > bufend) || 101 (pmt.ProgramInfo() + pmt.ProgramInfoLength() > bufend)) 102 { 103 return false; 104 } 105 106 for (uint i = 0; i < pmt.StreamCount(); i++) 107 { 108 if ((pmt.StreamInfo(i) > bufend) || 109 (pmt.StreamInfo(i) + pmt.StreamInfoLength(i) > bufend)) 110 { 111 return false; 112 } 113 } 114 } 115 } 116 69 117 ProgramAssociationTable* ProgramAssociationTable::CreateBlank(bool small) 70 118 { 71 119 (void) small; // currently always a small packet.. -
libs/libmythtv/mpeg/pespacket.h
249 249 250 250 unsigned char *_pesdata; ///< Pointer to PES data in full buffer 251 251 unsigned char *_fullbuffer; ///< Pointer to allocated data 252 private: 252 253 253 uint _psiOffset; ///< AFCOffset + StartOfFieldPointer 254 254 uint _ccLast; ///< Continuity counter of last inserted TS Packet 255 255 uint _pesdataSize; ///< Number of data bytes (TS header + PES data)