[FFmpeg-cvslog] avcodec/put_bits: Restore x64 ABI compatibility with releases <= 4.3

Andreas Rheinhardt git at videolan.org
Tue Mar 23 03:18:42 EET 2021


ffmpeg | branch: release/4.4 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Mar 22 07:05:17 2021 +0100| [5996184bea3e7e7b00ddc6256788cd3e59d75913] | committer: Andreas Rheinhardt

avcodec/put_bits: Restore x64 ABI compatibility with releases <= 4.3

88d80cb97528d52dac3178cf5393d6095eca6200 changed the type of
PutBitContext.BitBuf to uint64_t; it used to be an uint32_t.
While said structure is not public, it is nevertheless used by
certain avpriv functions and therefore crosses library boundaries:
avpriv_align_put_bits and avpriv_copy_bits were used in other libraries
in release 4.3 (and at the time of 88d80cb9) and so this commit broke
ABI.

This commit mitigates the trouble caused by this by using an uint32_t
again, but only for the 4.4 release branch and not the master branch,
as doing so for master, would break the ABI of master again, although
it is very unlikely that anyone would be helped by this (there don't
seem to be any users that combine libavcodec built from master and
libavformat from an old release: otherwise we would have received bug
reports about said ABI break).

Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavcodec/put_bits.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index cd66a82a44..f07944a8fb 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -35,16 +35,9 @@
 
 #include "version.h"
 
-#if ARCH_X86_64
-// TODO: Benchmark and optionally enable on other 64-bit architectures.
-typedef uint64_t BitBuf;
-#define AV_WBBUF AV_WB64
-#define AV_WLBUF AV_WL64
-#else
 typedef uint32_t BitBuf;
 #define AV_WBBUF AV_WB32
 #define AV_WLBUF AV_WL32
-#endif
 
 static const int BUF_BITS = 8 * sizeof(BitBuf);
 



More information about the ffmpeg-cvslog mailing list