[FFmpeg-devel] [PATCH] lavc/utils: generalize ff_init_buffer_info() and use it when seems feasible

Stefano Sabatini stefasab at gmail.com
Fri Aug 3 16:32:18 CEST 2012


On date Friday 2012-08-03 14:49:06 +0200, Stefano Sabatini encoded:
> On date Thursday 2012-08-02 19:52:57 +0200, Michael Niedermayer encoded:
> > On Thu, Aug 02, 2012 at 01:58:57PM +0200, Stefano Sabatini wrote:
> > > Extend ff_init_buffer_info() to init audio frames as well as video
> > > frames.
> > > 
> > > Avoid code duplication.
> > > ---
> > >  libavcodec/internal.h |    2 +-
> > >  libavcodec/pthread.c  |    2 +-
> > >  libavcodec/utils.c    |   59 ++++++++++++++++--------------------------------
> > >  3 files changed, 22 insertions(+), 41 deletions(-)
> > > 
> > > diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> > > index 993c42f..3d62a0f 100644
> > > --- a/libavcodec/internal.h
> > > +++ b/libavcodec/internal.h
> > > @@ -122,7 +122,7 @@ unsigned int avpriv_toupper4(unsigned int x);
> > >  /**
> > >   * does needed setup of pkt_pts/pos and such for (re)get_buffer();
> > >   */
> > > -void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic);
> > > +void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic, enum AVMediaType type);
> > 
> > in which case would 
> > s->codec->type differ (or be unavailable) from type ?
> 
> Indeed should not be required, patch updated, will apply it soon.
> 
> > except this the patch should be ok

Applied.
-- 
FFmpeg = Fabulous and Fierce Meaningless Picky Extravagant Generator


More information about the ffmpeg-devel mailing list