summaryrefslogtreecommitdiff
path: root/libavcodec/sbc_parser.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-06-04 12:31:31 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:44 -0300
commitb7483d02c246b1f5155eb156c98785830560a7b4 (patch)
treed047cf3dcc086a63c2e7187ba289e29ae8ac3b7b /libavcodec/sbc_parser.c
parent3caf14e0a4f6d79a79ad7644d0fa456616d3d40d (diff)
downloadffmpeg-b7483d02c246b1f5155eb156c98785830560a7b4.tar.gz
sbc: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/sbc_parser.c')
-rw-r--r--libavcodec/sbc_parser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/sbc_parser.c b/libavcodec/sbc_parser.c
index 8bf726b39e..2d427cc7cb 100644
--- a/libavcodec/sbc_parser.c
+++ b/libavcodec/sbc_parser.c
@@ -41,7 +41,9 @@ static int sbc_parse_header(AVCodecParserContext *s, AVCodecContext *avctx,
return -1;
if (data[0] == MSBC_SYNCWORD && data[1] == 0 && data[2] == 0) {
- avctx->channels = 1;
+ av_channel_layout_uninit(&avctx->ch_layout);
+ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+ avctx->ch_layout.nb_channels = 1;
avctx->sample_rate = 16000;
avctx->frame_size = 120;
s->duration = avctx->frame_size;
@@ -64,7 +66,9 @@ static int sbc_parse_header(AVCodecParserContext *s, AVCodecContext *avctx,
+ ((((mode == SBC_MODE_DUAL_CHANNEL) + 1) * blocks * bitpool
+ (joint * subbands)) + 7) / 8;
- avctx->channels = channels;
+ av_channel_layout_uninit(&avctx->ch_layout);
+ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+ avctx->ch_layout.nb_channels = channels;
avctx->sample_rate = sample_rates[sr];
avctx->frame_size = subbands * blocks;
s->duration = avctx->frame_size;