[vlc-devel] fixing a bug: preferred audio language select for .ogg
kostmo at gmail.com
Thu Sep 16 01:51:40 CEST 2010
>> 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?
Yes, in all of the .ogg files I've seen, the language attributes look
like this: "LANUGAGE=English" or "LANGUAGE=Japanese". In
vorbis_ParseComment() (defined in vlc/modules/demux/vorbis.h), I added
else IF_EXTRACT("LANGUAGE=", Language )
and added Language as another enum value. Also, I added a vlc_meta_t
*p_meta member to the logical_stream_s struct in modules/demux/ogg.h,
as it was previously only in the demux_sys_t struct. Calling
vorbis_ParseComment() with &p_stream->p_meta as the first argument
stores the appropriate language metadata in each stream separately.
With these modifications, the language string can later be retrieved
with vlc_meta_Get(p_stream->p_meta, vlc_meta_Language). I am unsure
how to accomplish all of this from within Ogg_ReadVorbisHeader(),
More information about the vlc-devel