summaryrefslogtreecommitdiff
path: root/libavcodec/amr_parser.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-05-07 07:20:32 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:40 -0300
commita4a73c6a9c2007dbea55519482499c7b7462ac9b (patch)
treefd99363eae27f6263c8b87e7901ab119fc6ee009 /libavcodec/amr_parser.c
parent62473cbd8e43cfcdca3024787e2baef6daff80ce (diff)
amr: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/amr_parser.c')
-rw-r--r--libavcodec/amr_parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/amr_parser.c b/libavcodec/amr_parser.c
index c0b14700e2..9484d720ee 100644
--- a/libavcodec/amr_parser.c
+++ b/libavcodec/amr_parser.c
@@ -63,9 +63,9 @@ static int amr_parse(AVCodecParserContext *s1,
*poutbuf_size = 0;
*poutbuf = NULL;
- if (!avctx->channels) {
- avctx->channels = 1;
- avctx->channel_layout = AV_CH_LAYOUT_MONO;
+ if (!avctx->ch_layout.nb_channels) {
+ av_channel_layout_uninit(&avctx->ch_layout);
+ avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
}
if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
@@ -73,7 +73,7 @@ static int amr_parse(AVCodecParserContext *s1,
} else {
int ch, offset = 0;
- for (ch = s->current_channel; ch < avctx->channels; ch++) {
+ for (ch = s->current_channel; ch < avctx->ch_layout.nb_channels; ch++) {
if (s->remaining >= 0) {
next = s->remaining;
} else {
@@ -96,7 +96,7 @@ static int amr_parse(AVCodecParserContext *s1,
}
}
- s->current_channel = ch % avctx->channels;
+ s->current_channel = ch % avctx->ch_layout.nb_channels;
if (s->remaining < 0)
next = offset;