[mythtv] Re : [Q]: CRC detection for packets

manu eallaud at yahoo.fr
Wed Jul 16 12:22:47 UTC 2008


Le 15.07.2008 15:14:29, manu a écrit :
> 	Hi all,
> I have a problem here. Looking at pespacket.h I see 
>     virtual bool HasCRC()     const { return (_pesdata[4] & 0x2) >> 
> 1; }
> 
> But here is a packet I need to parse (here I used dvbsnoop to get 
> it):
> 
> raw packet:
> 
> ------------------------------------------------------------
> SECT-Packet: 00000024   PID: 276 (0x0114), Length: 2019 (0x07e3)
> Time received: Wed 2008-06-04  14:59:54.114
> ------------------------------------------------------------
>   0000:  92 f7 e0 00 00 d9 2c 32  f2 49 0a 53 55 52 20 
> 4c   ......,2.I.SUR L
>   0010:  45 20 56 49 46 a0 37 30  2e 08 af 00 2e 40 e6 00   E 
> VIF.70..... at ..
> [snip]
>   07c0:  0d 20 0d 54 48 45 20 42  41 43 4b 57 4f 4f 44 53   . .THE 
> BACKWOODS
>   07d0:  b0 64 00 34 02 53 20 34  3a 1c 20 34 41 c7 20 03   .d.4.S 
> 4:.
> 
> 4A. .
>   07e0:  86 7d fb
> 
> Here is how it is decoded by dvbsnoop:
> 
> Guess table from table id...
> User_Defined-decoding....
> Table_ID: 146 (0x92)  [= User private]
> Section_syntax_indicator: 1 (0x01)
> private_indicator: 1 (0x01)
> reserved: 3 (0x03)
> private_section_length: 2016 (0x07e0)
> table_id_extension: 0 (0x0000)
> reserved: 3 (0x03)
> Version_number: 12 (0x0c)
> Current_next_indicator: 1 (0x01)  [= valid now]
> Section_number: 44 (0x2c)
> Last_section_number: 50 (0x32)
> Private Data:
>       0000:  f2 49 0a 53 55 52 20 4c  45 20 56 49 46 a0 37 
> 30   .I.SUR
> 
> LE VIF.70
>       0010:  2e 08 af 00 2e 40 e6 00  19 53 55 52 20 4c 45 
> 53   ..... at ...SUR LES
>  [snip]
>       07b0:  48 4f 57 90 19 80 1c 1a  0d 20 0d 54 48 45 20 42   
> HOW...... .THE B
>       07c0:  41 43 4b 57 4f 4f 44 53  b0 64 00 34 02 53 20 34   
> ACKWOODS.d.4.S 4
>       07d0:  3a 1c 20 34 41 c7 20                               :. 
> 4A.
> 
> CRC: 59145723 (0x03867dfb)
> 
> So as you can see dvbsnoop detects that it has a crc where mythtv 
> thinks that it does not.
> 
> I also have the reverse problem: pespacket discards packets because 
> they have a bad crc but actually they do not have crc.
> 
> So my question: what is the correct method to detect if a packet has 
> a
> 
> crc, the one in mythtv seems to be too simplistic.
> Thx
> Bye
> Manu

Hmm replying to myself: I found a doc describing the different packet 
structure, and especially for table of private type (user defined, ID 
between 0x80 and 0xff IIRC) the CRC bit is definitely not where we look 
for it). I'll take that into account and modify the code accordingly.
Sorry for the noise.
Bye
Manu





More information about the mythtv-dev mailing list