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

Mike Yan mikey at tlcwatch.com
Wed Jun 16 15:44:21 PDT 2004


Hi Ross,

Thanks for the suggestion.
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. And guest what, I got ultimate result. The parser
recovers instantly every time it encounters bad data. It does not take
forever to recover or die anymore. I recommend you to make a change on this
and test out yourself to see if I am right.

Best Regards,
Mike

-----Original Message-----
From: live-devel-bounces at ns.live.com [mailto:live-devel-bounces at ns.live.com]
On Behalf Of Ross Finlayson
Sent: Tuesday, June 15, 2004 3:14 AM
To: LIVE.COM Streaming Media - development & use
Subject: RE: [Live-devel] How to recover from parsing
exceptionaldatasituation!


>One thing I noticed that the period of recovering is
>uncertain. Sometimes it's fast, sometimes it's slow.

As long as you switch arbitrarily between streams, there's nothing you can 
do about this, because as far as the MPEG parsing code is concerned, it's 
seeing a corrupted input stream.

The only way to avoid this is to be smarter about when you switch streams: 
E.g., Don't switch away from a stream until you reach a 'pack start code' 
(0x000001BA), and then don't start using the new stream until you see a 
'pack start code'.  That way, the overall stream will look - to the parsng 
code - like a single, consistent MPEG stream.


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

_______________________________________________
live-devel mailing list
live-devel at lists.live.com
http://lists.live.com/mailman/listinfo/live-devel




More information about the live-devel mailing list