提交 98ac192b 编写于 作者: S Stefano Sabatini

ffprobe: provide format parameters to av_open_input_file()

Provide a non-NULL AVFormatParameters structure to
av_open_input_file() in open_input_file().

This is required because otherwise av_open_input_file() will allocate
and use a new format context, discarding the options set in the
provided format context.
上级 ca1a2a47
......@@ -261,12 +261,15 @@ static void show_format(AVFormatContext *fmt_ctx)
static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
{
int err, i;
AVFormatParameters fmt_params;
AVFormatContext *fmt_ctx;
memset(&fmt_params, 0, sizeof(fmt_params));
fmt_params.prealloced_context = 1;
fmt_ctx = avformat_alloc_context();
set_context_opts(fmt_ctx, avformat_opts, AV_OPT_FLAG_DECODING_PARAM, NULL);
if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, NULL)) < 0) {
if ((err = av_open_input_file(&fmt_ctx, filename, iformat, 0, &fmt_params)) < 0) {
print_error(filename, err);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册