summaryrefslogtreecommitdiffstats
path: root/ffmpeg_opt.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2014-11-09 18:28:29 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2014-11-09 18:28:29 +0100
commite971eef8c0d2ebe461bb17f19a590b53511cc8f2 (patch)
treeedaa9749b0e3fd005071d47dd00c11412f3ca3bd /ffmpeg_opt.c
parent4e179436b6c859ae2e47ab088de8fc89b379a07b (diff)
downloadffmpeg-streaming-e971eef8c0d2ebe461bb17f19a590b53511cc8f2.zip
ffmpeg-streaming-e971eef8c0d2ebe461bb17f19a590b53511cc8f2.tar.gz
Set -scan_all_pmts 1 in ffmpeg, ffplay and ffprobe if not set by user.
Fixes ticket #3762.
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 454da98..77ef0c4 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -794,6 +794,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
char * video_codec_name = NULL;
char * audio_codec_name = NULL;
char *subtitle_codec_name = NULL;
+ int scan_all_pmts_set = 0;
if (o->format) {
if (!(file_iformat = av_find_input_format(o->format))) {
@@ -864,12 +865,18 @@ static int open_input_file(OptionsContext *o, const char *filename)
ic->flags |= AVFMT_FLAG_NONBLOCK;
ic->interrupt_callback = int_cb;
+ if (!av_dict_get(o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
+ av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
+ scan_all_pmts_set = 1;
+ }
/* open the input file with generic avformat function */
err = avformat_open_input(&ic, filename, file_iformat, &o->g->format_opts);
if (err < 0) {
print_error(filename, err);
exit_program(1);
}
+ if (scan_all_pmts_set)
+ av_dict_set(&o->g->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
remove_avoptions(&o->g->format_opts, o->g->codec_opts);
assert_avoptions(o->g->format_opts);
OpenPOWER on IntegriCloud