summaryrefslogtreecommitdiff
path: root/ffplay.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 /ffplay.c
parent4e179436b6c859ae2e47ab088de8fc89b379a07b (diff)
Set -scan_all_pmts 1 in ffmpeg, ffplay and ffprobe if not set by user.
Fixes ticket #3762.
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index e04f622488..490bffa8b1 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2890,6 +2890,7 @@ static int read_thread(void *arg)
AVDictionary **opts;
int orig_nb_streams;
SDL_mutex *wait_mutex = SDL_CreateMutex();
+ int scan_all_pmts_set = 0;
memset(st_index, -1, sizeof(st_index));
is->last_video_stream = is->video_stream = -1;
@@ -2899,12 +2900,19 @@ static int read_thread(void *arg)
ic = avformat_alloc_context();
ic->interrupt_callback.callback = decode_interrupt_cb;
ic->interrupt_callback.opaque = is;
+ if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
+ av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
+ scan_all_pmts_set = 1;
+ }
err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
if (err < 0) {
print_error(is->filename, err);
ret = -1;
goto fail;
}
+ if (scan_all_pmts_set)
+ av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
+
if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
ret = AVERROR_OPTION_NOT_FOUND;