[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 14:49:06 CEST 2012


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
-- 
FFmpeg = Fundamental & Faithless Martial Picky Erroneous Gangster
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-lavc-utils-generalize-ff_init_buffer_info-and-use-it.patch
Type: text/x-diff
Size: 3308 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120803/3d426f1f/attachment.bin>


More information about the ffmpeg-devel mailing list