[FFmpeg-devel] [PATCH] eliminate long from ByteIOContext structure

Reimar Döffinger Reimar.Doeffinger
Mon Mar 31 20:25:08 CEST 2008


Hello,
On Mon, Mar 31, 2008 at 08:13:34PM +0200, Diego Biurrun wrote:
> Here is a patch to remove long from the ByteIOContext structure with the
> next major version bump.  This was recently requested, so let's give it
> to people.  Possibly the use of uint32_t is better, I'm sure somebody
> will point this out to me shortly if necessary.

Since this is just a "wrapper" around the crc code in libavutil and that
one uses uint32_t, yes uint32_t is better.
But there is also the problem that the function assigned to
update_checksum still is "unsigned long" always after your patch, which
might break rather badly in some theoretical ABI.
I have been thinking about this myself, and the only idea I had for
doing this without massive ifdeffery was something extremely ugly
like and possibly broken
> #if LIBAVFORMAT_VERSION_MAJOR >= 53
> typedef uint32_t ff_checksum_t av_deprecated;
> #else
> typedef unsigned long ff_checksum_t av_deprecated;
> #endif

A define may be better, but then there is no way like av_deprecated to
discourage use of it...
It looks really ugly either way though...




More information about the ffmpeg-devel mailing list