aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adxdec.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-04-04 16:17:30 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:39 -0300
commit4407054ff0eec66c3ca8040607cfc8d952f772d7 (patch)
tree30328518ee4e2a2474c0e8e2f0fd7af6efa2e1d6 /libavcodec/adxdec.c
parent984612a403deb751adf2e31a1d8e9dfbd99c6f98 (diff)
downloadffmpeg-4407054ff0eec66c3ca8040607cfc8d952f772d7.tar.gz
adx: convert to new channel layout API
Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r--libavcodec/adxdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 20256a092e..b3d946e81c 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -46,7 +46,7 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
return AVERROR_INVALIDDATA;
}
- c->channels = avctx->channels;
+ c->channels = avctx->ch_layout.nb_channels;
c->header_parsed = 1;
}
@@ -132,7 +132,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "error parsing ADX header\n");
return AVERROR_INVALIDDATA;
}
- c->channels = avctx->channels;
+ c->channels = avctx->ch_layout.nb_channels;
c->header_parsed = 1;
if (buf_size < header_size)
return AVERROR_INVALIDDATA;
@@ -147,7 +147,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
/* if the packet is not an even multiple of BLOCK_SIZE, check for an EOF
packet */
- if (!num_blocks || buf_size % (BLOCK_SIZE * avctx->channels)) {
+ if (!num_blocks || buf_size % (BLOCK_SIZE * c->channels)) {
if (buf_size >= 4 && (AV_RB16(buf) & 0x8000)) {
c->eof = 1;
*got_frame_ptr = 0;