[vlc-devel] Re: Doing an lseek() with VOB files ...

j.zorko at att.net j.zorko at att.net
Wed Aug 13 21:18:40 CEST 2003


<<            else
                /* This can indicate that we missed a packet or that the
                 * continuity_counter wrapped and we received a dup packet:

If the continuity_counter wraps (at 16) then there is no duplicate packet! The continuity counter 
always wraps at 16 !!

                 * as we don't know, do as if we missed a packet to be sure
                 * to recover from this situation */

Why ? This is a legal situation for TS packets

                msg_Warn( p_input,
                          "packet lost by TS demux for PID %d: current %d, packet %d",
                          p_es_demux->i_continuity_counter & 0x0f,
                          p[3] & 0x0f );
                b_lost = 1;
                p_es_demux->i_continuity_counter = p[3] & 0x0f;
FILE *pFile = fopen( "//Users//jmzorko//vlc_debug.txt", "a+" );
fprintf( pFile, "* " );
fclose( pFile );
            } /* not continuous */
... I put the fopen / fprintf in system.c, and then ran the test (server VLC, client VLC, telling 
server VLC to seek and seeing what shakes with the client VLC).  The results are interesting -- 
the "*" only appeared in the vlc_debug.txt file 7 times, though I told the server VLC to seek 
dozens of times.  Does this indicate that the discontinuity bit isn't always being set by the server 

You did not even set the bit ;-) You've got it mixed up with the continuity counter which is 
another bit in the TS header. >>

I should probably make something a bit more cogent -- the only code I added to VLC in the 
above piece is the fopen / fprintf / fclose.  Everything else was already there -- I only added the 
fopen / fprintf / fclose code to try to narrow down where the problem may be happening.  A 
quick look at modules/demux/mpeg/system.c will make this clear.

Anyway, that fopen / fprintf / fclose only happened on the client VLC 7 times during my test, 
while I seeked on the server VLC providing the stream dozens of times.  Can I infer from this 
that the server VLC, after a seek, is not setting the discontinuity bit in the TS header correctly 
before sending it out?



Falling You - exploring the beauty of voice and sound
New EP, "hope thrown down," available now at

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