[FFmpeg-devel] [PATCH]Set -scan_all_pmts 1 in ffmpeg, ffplay and ffprobe

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Nov 8 23:35:04 CET 2014


Hi!

Attached patch fixes ticket #3762 for me.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 454da98..7551cc3 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -843,6 +843,8 @@ static int open_input_file(OptionsContext *o, const char *filename)
     if (o->nb_frame_pix_fmts)
         av_dict_set(&o->g->format_opts, "pixel_format", o->frame_pix_fmts[o->nb_frame_pix_fmts - 1].u.str, 0);
 
+    av_dict_set(&o->g->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
+
     MATCH_PER_TYPE_OPT(codec_names, str,    video_codec_name, ic, "v");
     MATCH_PER_TYPE_OPT(codec_names, str,    audio_codec_name, ic, "a");
     MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, ic, "s");
diff --git a/ffplay.c b/ffplay.c
index a979164..2fb6a59 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2863,6 +2863,7 @@ static int read_thread(void *arg)
     ic = avformat_alloc_context();
     ic->interrupt_callback.callback = decode_interrupt_cb;
     ic->interrupt_callback.opaque = is;
+    av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
     err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts);
     if (err < 0) {
         print_error(is->filename, err);
diff --git a/ffprobe.c b/ffprobe.c
index 3eb0208..ca5b588 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2387,6 +2387,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
     AVDictionaryEntry *t;
     AVDictionary **opts;
 
+    av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
     if ((err = avformat_open_input(&fmt_ctx, filename,
                                    iformat, &format_opts)) < 0) {
         print_error(filename, err);


More information about the ffmpeg-devel mailing list