Browse Source

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4
Michael Niedermayer 10 years ago
parent
commit
7d03732f7e
3 changed files with 11 additions and 0 deletions
  1. +9
    -0
      ffmpeg.c
  2. +1
    -0
      ffmpeg.h
  3. +1
    -0
      ffmpeg_opt.c

+ 9
- 0
ffmpeg.c View File

@@ -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;


+ 1
- 0
ffmpeg.h View File

@@ -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);


+ 1
- 0
ffmpeg_opt.c View 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 */


Loading…
Cancel
Save