[vlc-devel] [PATCH 2/2] Fix libvlc_media_get_tracks_info()

Laurent Aimar fenrir at elivagar.org
Thu Dec 2 21:17:57 CET 2010


On Thu, Dec 02, 2010 at 09:49:29AM +0100, Rafaël Carré wrote:
> Without checking for the codec, we can see the input codec (what
> interests us) be replaced by the output pixel format, e.g.
>     mp4v -> I420
> 
> The es identifier (es_format_t::i_id) is also not consistent and we can
> see e.g.
>     mp4v -> mpga (the video ES is replaced by the audio ES)

 In fact, in
EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *fmt, const vlc_meta_t * )
when calling input_item_UpdateTracksInfo, you should use es->i_meta_id as
unique identifier (and not fmt->i_id). This one is stable for an ES and reproductible.

 Now, the first time EsOutUpdateInfo() is called, you have the format of the
ES as given by the demuxer, while the next times, you have the format given by
the output of the decoder. This explain why you can see the fourcc changing...

 I think you should call input_item_UpdateTracksInfo (from EsOutUpdateInfo) only if
fmt->i_cat == es->fmt.i_cat
(a decoder can change a type into another one, the only case probably being
subtitle->video with CDG tracks) and in which case you should give it a
es_format_t build by:

es_format_t es_tmp = *fmt;
es_tmp.i_id = es->i_meta_id;
es_tmp.i_codec = es->fmt.i_codec;
es_tmp.i_original_fourcc = es->fmt.i_original_fourcc;

-- 
fenrir



More information about the vlc-devel mailing list