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

Rafaël Carré rafael.carre at gmail.com
Thu Dec 2 09:49:29 CET 2010


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)
---
 src/input/item.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/input/item.c b/src/input/item.c
index e47a1e1..273cc9a 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1071,9 +1071,13 @@ void input_item_UpdateTracksInfo(input_item_t *item, const es_format_t *fmt)
             continue;
 
         /* We've found the right ES, replace it */
+        /* FIXME: Unless it's not really the right ES */
+        if (item->es[i]->i_codec == fmt->i_codec)
+        {
         es_format_Clean(item->es[i]);
         free(item->es[i]);
         item->es[i] = fmt_copy;
+        }
         vlc_mutex_unlock( &item->lock );
         return;
     }
-- 
1.7.3.2





More information about the vlc-devel mailing list