[FFmpeg-cvslog] ffprobe: provide format parameters to av_open_input_file()
Stefano Sabatini
git at videolan.org
Sat Mar 26 15:03:28 CET 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Thu Mar 24 14:39:23 2011 +0100| [98ac192b4e4df786107d7f6adb3e4e7d1336510e] | committer: 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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98ac192b4e4df786107d7f6adb3e4e7d1336510e
---
ffprobe.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/ffprobe.c b/ffprobe.c
index d7362dd..9c2fd43 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -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;
}
More information about the ffmpeg-cvslog
mailing list