[FFmpeg-cvslog] ffmpeg: Do not fail if a demuxer and decoder use the same option identifer

Michael Niedermayer git at videolan.org
Mon Aug 4 13:39:14 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Aug  4 13:32:11 2014 +0200| [7d03732f7e6018c87cc30e2cedb9bd9f7d7e43d7] | committer: Michael Niedermayer

ffmpeg: Do not fail if a demuxer and decoder use the same option identifer

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d03732f7e6018c87cc30e2cedb9bd9f7d7e43d7
---

 ffmpeg.c     |    9 +++++++++
 ffmpeg.h     |    1 +
 ffmpeg_opt.c |    1 +
 3 files changed, 11 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1c1a559..8dd9c08 100644
--- 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;
diff --git a/ffmpeg.h b/ffmpeg.h
index 30890a0..06ef132 100644
--- 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);
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 99182e0..9604a6a 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -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 */



More information about the ffmpeg-cvslog mailing list