[FFmpeg-cvslog] avcodec: Add padding after the remaining AVFrames

Michael Niedermayer git at videolan.org
Wed Jun 25 17:01:25 CEST 2014


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Tue Mar 18 00:08:54 2014 +0100| [3ae71dd33ed3a4fb36994622bf4ed0418027150e] | committer: Michael Niedermayer

avcodec: Add padding after the remaining AVFrames

This limits ABI issues in case libavcodec is linked to a libavutil with larger AVFrame
Which can happen if they are shiped in seperate binary packages and libavutil is upgraded

A cleaner alternative would be to replace them by pointers but this would likely cause
a small speedloss

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit fc567ac49e17151f00f31b59030cd10f952612ef)

Conflicts:

	libavcodec/h264.h

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ae71dd33ed3a4fb36994622bf4ed0418027150e
---

 libavcodec/mpegvideo.h |    1 +
 libavcodec/utils.c     |    1 +
 2 files changed, 2 insertions(+)

diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index cbd01c4..f72e89e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -96,6 +96,7 @@ struct MpegEncContext;
  */
 typedef struct Picture{
     struct AVFrame f;
+    uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
     ThreadFrame tf;
 
     AVBufferRef *qscale_table_buf;
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 7a45653..f3dc853 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -682,6 +682,7 @@ int avcodec_default_get_buffer(AVCodecContext *avctx, AVFrame *frame)
 typedef struct CompatReleaseBufPriv {
     AVCodecContext avctx;
     AVFrame frame;
+    uint8_t avframe_padding[1024]; // hack to allow linking to a avutil with larger AVFrame
 } CompatReleaseBufPriv;
 
 static void compat_free_buffer(void *opaque, uint8_t *data)



More information about the ffmpeg-cvslog mailing list