提交 4f731c44 编写于 作者: A Anton Khirnov

lavf: restore old behavior for custom AVIOContex with an AVFMT_NOFILE format.

av_open_input_stream used to allow this, even though it makes no sense.
Make it just print a warning instead of failing, thus restoring
compatibility.

Note that avformat_open_input() will still reject this combination.
Signed-off-by: NAnton Khirnov <anton@khirnov.net>
上级 5001d6ef
......@@ -459,9 +459,14 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
err = AVERROR(ENOMEM);
goto fail;
}
ic->pb = pb;
if (pb && fmt && fmt->flags & AVFMT_NOFILE)
av_log(ic, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "
"will be ignored with AVFMT_NOFILE format.\n");
else
ic->pb = pb;
err = avformat_open_input(&ic, filename, fmt, &opts);
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above
*ic_ptr = ic;
fail:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册