[vlc-commits] avformat: fix dictionary use

Rafaël Carré git at videolan.org
Tue Apr 17 14:50:44 CEST 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Apr 17 08:43:02 2012 -0400| [d52f2cef5a006d97e326745e6aab961cd9c075af] | committer: Rafaël Carré

avformat: fix dictionary use

show the invalid options for the first stream only (following dictionaries are identical)
free all the options array

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d52f2cef5a006d97e326745e6aab961cd9c075af
---

 modules/demux/avformat/demux.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 785bf33..8142689 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -265,10 +265,12 @@ int OpenDemux( vlc_object_t *p_this )
     error = avformat_find_stream_info( p_sys->ic, options );
     vlc_avcodec_unlock();
     AVDictionaryEntry *t = NULL;
-    while ((t = av_dict_get(options, "", t, AV_DICT_IGNORE_SUFFIX))) {
+    while ((t = av_dict_get(options[0], "", t, AV_DICT_IGNORE_SUFFIX))) {
         msg_Err( p_demux, "Unknown option \"%s\"", t->key );
     }
-    av_dict_free(&options);
+    for (unsigned i = 0; i < p_sys->ic->nb_streams; i++) {
+        av_dict_free(&options[i]);
+    }
 #else
     vlc_avcodec_lock(); /* avformat calls avcodec behind our back!!! */
     error = av_find_stream_info( p_sys->ic );



More information about the vlc-commits mailing list