summaryrefslogtreecommitdiff
path: root/libavcodec/libcelt_dec.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-06-04 17:23:37 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:42 -0300
commit89dc056b0106e3ef01a3499e8a43af7c7dfe2646 (patch)
treecae0411e12e2a0c3f6459994ff5fa6f8aaa94eb6 /libavcodec/libcelt_dec.c
parentdd544b5ef0f4d4bd2f235e8bfc1d6526df759613 (diff)
libcelt: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libcelt_dec.c')
-rw-r--r--libavcodec/libcelt_dec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/libcelt_dec.c b/libavcodec/libcelt_dec.c
index c0fb4013c9..6ee6e29443 100644
--- a/libavcodec/libcelt_dec.c
+++ b/libavcodec/libcelt_dec.c
@@ -61,13 +61,13 @@ static av_cold int libcelt_dec_init(AVCodecContext *c)
struct libcelt_context *celt = c->priv_data;
int err;
- if (!c->channels || !c->frame_size ||
- c->frame_size > INT_MAX / sizeof(int16_t) / c->channels)
+ if (!c->ch_layout.nb_channels || !c->frame_size ||
+ c->frame_size > INT_MAX / sizeof(int16_t) / c->ch_layout.nb_channels)
return AVERROR(EINVAL);
celt->mode = celt_mode_create(c->sample_rate, c->frame_size, &err);
if (!celt->mode)
return ff_celt_error_to_averror(err);
- celt->dec = celt_decoder_create_custom(celt->mode, c->channels, &err);
+ celt->dec = celt_decoder_create_custom(celt->mode, c->ch_layout.nb_channels, &err);
if (!celt->dec) {
celt_mode_destroy(celt->mode);
return ff_celt_error_to_averror(err);
@@ -119,8 +119,8 @@ static int libcelt_dec_decode(AVCodecContext *c, void *data,
return ff_celt_error_to_averror(err);
if (celt->discard) {
frame->nb_samples -= celt->discard;
- memmove(pcm, pcm + celt->discard * c->channels,
- frame->nb_samples * c->channels * sizeof(int16_t));
+ memmove(pcm, pcm + celt->discard * c->ch_layout.nb_channels,
+ frame->nb_samples * c->ch_layout.nb_channels * sizeof(int16_t));
celt->discard = 0;
}
*got_frame_ptr = 1;