提交 b1245d43 编写于 作者: Z Zhang Rui

ff_ffplay: merge e971eef8c0d2ebe461bb17f19a590b53511cc8f2

Set -scan_all_pmts 1 in ffmpeg, ffplay and ffprobe if not set by user.

Fixes ticket #3762.
上级 dd8c1025
......@@ -2158,6 +2158,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;
int last_error = 0;
int64_t prev_io_tick_counter = 0;
int64_t io_tick_counter = SDL_GetTickHR();
......@@ -2172,6 +2173,10 @@ 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(ffp->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) {
av_dict_set(&ffp->format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE);
scan_all_pmts_set = 1;
}
if (ffp->format_control_message) {
av_format_set_control_message_cb(ic, ffp_format_control_message);
av_format_set_opaque(ic, ffp);
......@@ -2182,6 +2187,9 @@ static int read_thread(void *arg)
ret = -1;
goto fail;
}
if (scan_all_pmts_set)
av_dict_set(&ffp->format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
if ((t = av_dict_get(ffp->format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
#ifdef FFP_MERGE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册