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

Michael Niedermayer michaelni at gmx.at
Thu Aug 2 19:52:57 CEST 2012


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 ?

except this the patch should be ok

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

There will always be a question for which you do not know the correct awnser.
-------------- 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/20120802/9f2ea229/attachment.asc>


More information about the ffmpeg-devel mailing list