]> git.sesse.net Git - ffmpeg/commitdiff
ffmpeg: Do not fail if a demuxer and decoder use the same option identifer
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Aug 2014 11:32:11 +0000 (13:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Aug 2014 11:33:44 +0000 (13:33 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c
ffmpeg.h
ffmpeg_opt.c

index 1c1a5599d0a7e8a4a257f6e23b9f55476fd3a460..8dd9c08452f765542efd6ce9c3c4a3f3481c3c69 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -532,6 +532,15 @@ static void ffmpeg_cleanup(int ret)
     term_exit();
 }
 
+void remove_avoptions(AVDictionary **a, AVDictionary *b)
+{
+    AVDictionaryEntry *t = NULL;
+
+    while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) {
+        av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE);
+    }
+}
+
 void assert_avoptions(AVDictionary *m)
 {
     AVDictionaryEntry *t;
index 30890a0ee85f9561c46273d20203ebde17d0deae..06ef13243ace37f401fa27d5416e4a35c9662eb9 100644 (file)
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -502,6 +502,7 @@ void show_usage(void);
 
 void opt_output_file(void *optctx, const char *filename);
 
+void remove_avoptions(AVDictionary **a, AVDictionary *b);
 void assert_avoptions(AVDictionary *m);
 
 int guess_input_channel_layout(InputStream *ist);
index 99182e0914cb20bdb8187473dfc986ff71064dbe..9604a6a5d52e8c45d2f8e0caa28c7952d96f2627 100644 (file)
@@ -872,6 +872,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
         print_error(filename, err);
         exit_program(1);
     }
+    remove_avoptions(&o->g->format_opts, o->g->codec_opts);
     assert_avoptions(o->g->format_opts);
 
     /* apply forced codec ids */