aboutsummaryrefslogtreecommitdiffstats
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:44 -0300
commitfb722bab3e152f7402a4e466bcdee4aa61dd7f75 (patch)
tree48c9d89f64426176f153d6453723bd29f9513c04
parentb7483d02c246b1f5155eb156c98785830560a7b4 (diff)
downloadffmpeg-fb722bab3e152f7402a4e466bcdee4aa61dd7f75.tar.gz
shorten: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/shorten.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index fde5c4b982..6cce675c9f 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -428,7 +428,11 @@ static int read_header(ShortenContext *s)
s->channels = 0;
return AVERROR_INVALIDDATA;
}
- s->avctx->channels = s->channels;
+ if (s->avctx->ch_layout.nb_channels != s->channels) {
+ av_channel_layout_uninit(&s->avctx->ch_layout);
+ s->avctx->ch_layout.nb_channels = s->channels;
+ s->avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
+ }
/* get blocksize if version > 0 */
if (s->version > 0) {