[FFmpeg-devel] [PATCH] ffprobe: provide format parameters to av_open_input_file()

Michael Niedermayer michaelni at gmx.at
Fri Mar 25 19:34:17 CET 2011


On Fri, Mar 25, 2011 at 07:21:48PM +0100, Stefano Sabatini wrote:
> On date Friday 2011-03-25 19:12:52 +0100, Stefano Sabatini encoded:
> > 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.
> > ---
> >  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;
> >      }
> 
> BTW what was the plan for getting rid of AVFormatParameters? (I
> suppose that would require to move params to AVFormatContext).

yes

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110325/fd0ed559/attachment.asc>


More information about the ffmpeg-devel mailing list