[Live-devel] How to recover from parsing exceptionaldatasituation!

Ross Finlayson finlayson at live.com
Wed Jun 16 15:53:43 PDT 2004


>However, I did a lot of test on the switching issue and have been made some
>modification on MPEG1or2Demux class base on the changes you made on the last
>version (6.14.2004). Here is the change:
>
>     setParseState(PARSING_PACK_HEADER); // ensures we progress over bad data
>     skipBytes(33);                      (line 399 in MPEG1or2Demux.cpp)
>
>Basically, I changed the number of the bytes to skip from 1 to 33 after
>encounter bad data.

Why 33?  This seems rather arbitrary.  In fact, it seems possible that in 
skipping that many bytes, you'll skip over a 'system code' that you're 
looking for.

Here is the actual change that I will be making (in the next release of the 
code):

     setParseState(PARSING_PACK_HEADER); // ensures we progress over bad data
     if (first4Bytes&0xFF > 1) { // a system code definitely doesn't start here
       skipBytes(4);
     } else {
       skipBytes(1);
     }




	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>



More information about the live-devel mailing list