[vlc-devel] Re: (hopefully) simple question on stream clocking

Jean-Paul Saman saman at natlab.research.philips.com
Mon Sep 8 12:04:49 CEST 2003

John Michael Zorko wrote:
> Hello, all ...
> After implementing the TS discontinuity indicator setting code, and 
> resetting the decoders on the client when this bit is detected in the TS 
> packet, and making sure I seek to an E0 packet (video ES) with a 
> sequence header, 95% of the macroblocking artifacts I see on the client 
> when the server VLC does a seek on the stream are gone.  The few that 
> are left may be due to open GOPs, but i'll worry about that later.  
> Thanks to everyone who posted hints on how to do this -- it's appreciated!
Could be or you forgot to set the TS discontinuity bit on other pid's 
too! After a seek ALL PIDs in the stream need to be told that a 
discontinuity happend (video,audio,teletext,PCR packets).

> Now, i've a (hopefully) simple question ... sometimes the client VLC 
> stops updating the video after the server VLC seeks.  I've verified that 
> the server VLC seeked to where I wanted it to (the E0 PES packet with a 
> sequence header).  Sometimes it recovers after a second or two, 
> sometimes it takes far longer (10-20 seconds), sometimes never.  This is 
> sometimes accompanied by the infamous "decoder stuck" message, which 
> implies that the vout thread is the culprit i.e. perhaps on an mwait() 
> waiting to display a frame.  On the server, all it does is call 
> input_Seek() to the position I want, then set the TS discontinuity 
> indicator.  I don't do anything different with the PTS i.e. the TS muxer 
> does what it always did, it just sets the TS discontinuity indicator 
> when it should now.

Looks like a forgotten TS flag. Is there a way you can verify this?

> The client, when it sees the TS discontinuity indicator on, does 
> input_EscapeDiscontinuity() -- nothing else special.  Yet sometimes 
> (after a lot of seeking on the server), the vout thread hangs.  Does the 
> server VLC need to do something special to the PTS after a seek, 
> something that it normally doesn't need to do?
AFAIK you should not tinker with the PTS. If you do the DTS and PCR's 
need to be updated too, this will actually equal to a decode-encode 
cycle (reencode the audio/video).

Kind greetings,

Jean-Paul Saman

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list