@@ -306,7 +306,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
#if LIBAVCODEC_VERSION_MAJOR < 59
avctx->extradata_size * 8, 1);
#else
- avctx->extradata_size * 8, 1, avctx);
+ avctx->extradata_size, 1, avctx);
#endif
if (config_offset < 0)
@@ -154,21 +154,25 @@ int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb,
#if LIBAVCODEC_VERSION_MAJOR < 59
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
- int bit_size, int sync_extension)
+ int size, int sync_extension)
{
void *logctx = NULL;
#else
int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
- int bit_size, int sync_extension, void *logctx)
+ int size, int sync_extension, void *logctx)
{
#endif
GetBitContext gb;
int ret;
- if (bit_size <= 0)
+ if (size <= 0)
return AVERROR_INVALIDDATA;
- ret = init_get_bits(&gb, buf, bit_size);
+#if LIBAVCODEC_VERSION_MAJOR < 59
+ ret = init_get_bits(&gb, buf, size);
+#else
+ ret = init_get_bits8(&gb, buf, size);
+#endif
if (ret < 0)
return ret;
@@ -72,7 +72,7 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
#if LIBAVCODEC_VERSION_MAJOR < 59
int bit_size, int sync_extension);
#else
- int bit_size, int sync_extension, void *logctx);
+ int size, int sync_extension, void *logctx);
#endif
enum AudioObjectType {
@@ -1855,7 +1855,7 @@ static av_cold int decode_init_mp3on4(AVCodecContext * avctx)
#if LIBAVCODEC_VERSION_MAJOR < 59
avctx->extradata_size * 8, 1);
#else
- avctx->extradata_size * 8, 1, avctx);
+ avctx->extradata_size, 1, avctx);
#endif
if (!cfg.chan_config || cfg.chan_config > 7) {
av_log(avctx, AV_LOG_ERROR, "Invalid channel config number.\n");
@@ -56,7 +56,7 @@ static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
#if LIBAVCODEC_VERSION_MAJOR < 59
off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
#else
- off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1, s);
+ off = avpriv_mpeg4audio_get_config(&m4ac, buf, size, 1, s);
#endif
if (off < 0)
return off;
@@ -551,7 +551,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
#if LIBAVCODEC_VERSION_MAJOR < 59
st->codecpar->extradata_size * 8, 1);
#else
- st->codecpar->extradata_size * 8, 1, fc);
+ st->codecpar->extradata_size, 1, fc);
#endif
if (ret < 0)
return ret;
@@ -65,7 +65,7 @@ static int latm_decode_extradata(AVFormatContext *s, uint8_t *buf, int size)
#if LIBAVCODEC_VERSION_MAJOR < 59
ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1);
#else
- ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size * 8, 1, s);
+ ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size, 1, s);
#endif
if (ctx->off < 0)
return ctx->off;
@@ -721,7 +721,7 @@ static int get_aac_sample_rates(AVFormatContext *s, uint8_t *extradata, int extr
#if LIBAVCODEC_VERSION_MAJOR < 59
extradata_size * 8, 1);
#else
- extradata_size * 8, 1, s);
+ extradata_size, 1, s);
#endif
/* Don't abort if the failure is because of missing extradata. Assume in that
* case a bitstream filter will provide the muxer with the extradata in the
This is an ABI change, so it's scheduled for the next bump. Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/alsdec.c | 2 +- libavcodec/mpeg4audio.c | 12 ++++++++---- libavcodec/mpeg4audio.h | 2 +- libavcodec/mpegaudiodec_template.c | 2 +- libavformat/adtsenc.c | 2 +- libavformat/isom.c | 2 +- libavformat/latmenc.c | 2 +- libavformat/matroskaenc.c | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-)