[vlc-devel] fixing a bug: preferred audio language select for .ogg

Jean-Baptiste Kempf jb at videolan.org
Thu Sep 16 01:25:57 CEST 2010

On Wed, Sep 15, 2010 at 07:16:23AM -0500, Karl Ostmo wrote :
> The problem is that unlike with .mkv files, with .ogm files the
> es->fmt.psz_language variable is not set by the time that EsOutAdd()
> is called.  In fact, currently the variable is never set for Vorbis
> audio streams.  Ideally, the variable would be set in
> Ogg_ReadVorbisHeader() of ogg.c.  However, it looks like the header
> data is not fully extracted until up to 3 packets have been read in
> Ogg_DecodePacket().

I believe you need to do it in Ogg_ReadVorbisHeader() as it is done in

> At that point the function Ogg_ExtractMeta() is called, which itself
> makes a call to vorbis_ParseComment() where the stream's language
> attribute could be extracted.  Unfortunately, this finally happens
> well after Ogg_BeginningOfStream() had been called (which is where
> EsOutAdd() happens).
Are you saying the language is set inside the comments?

Best Regards,

Jean-Baptiste Kempf
+33 672 704 734

More information about the vlc-devel mailing list