[vlc-devel] [PATCH] Do not delay processing of the first data page of the last logical stream in an Ogg stream

Laurent Aimar fenrir at via.ecp.fr
Fri Nov 14 18:56:35 CET 2008

On Thu, Nov 13, 2008, ogg.k.ogg.k at googlemail.com wrote:
> The first data page of a physical stream is stored in the relevant
> logical stream
> in Ogg_FindLogicalStreams. Therefore, we must not read a page and only
> update the
> stream it belongs to if we haven't processed this first page yet. If we do, we
> will only process that first page whenever we find the second page for
> this stream.
> While this is fine for Vorbis and Theora, which are continuous codecs,
> which means
> the second page will arrive real quick, this is not fine for Kate, whose second
> data page will typically arrive much later.
> This means it is now possible to seek right at the start of a stream
> where the last
> logical stream is Kate, without having to wait for the second data
> page to unblock
> the first one, which is the one that triggers the 'no more headers to
> backup' code.
> And, as we all know, seeking without having backed up all headers is
> bad, since the
> codec will fail to initialize if it's missing its headers.

 Is there anyone that seems more competent on ogg thanme to check it ?
If not, I will take care of it.

> +        if (!p_sys->b_page_waiting)
 Coding style consistency.

>                  /* Last header received, commit changes */
> -                free( p_stream->fmt.p_extra );
> +                /* why ? realloced below... free( p_stream->fmt.p_extra ); */
 That one should be a separate patch if it is a double free error.

> +                --p_ogg->i_bos;
 Please use var-- (consistency).

> +                    ++p_ogg->i_bos;
 Same here.


More information about the vlc-devel mailing list