summaryrefslogtreecommitdiff
path: root/libavcodec/dfpwmdec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-03-10 10:57:39 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:41 -0300
commit441fe2508da82b1824d71d5b62059c17262eb76d (patch)
treee1b31bc998895c0bcd76b7b7ade687044eb2e7e8 /libavcodec/dfpwmdec.c
parentb2af4bc807cfc62d61213c6050aac26ec8a1e675 (diff)
dfpw: convert to new channel layout API
Diffstat (limited to 'libavcodec/dfpwmdec.c')
-rw-r--r--libavcodec/dfpwmdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmdec.c
index 05f79448ef..27b60a4ea4 100644
--- a/libavcodec/dfpwmdec.c
+++ b/libavcodec/dfpwmdec.c
@@ -83,7 +83,7 @@ static av_cold int dfpwm_dec_init(struct AVCodecContext *ctx)
{
DFPWMState *state = ctx->priv_data;
- if (ctx->channels <= 0) {
+ if (ctx->ch_layout.nb_channels <= 0) {
av_log(ctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR(EINVAL);
}
@@ -106,7 +106,7 @@ static int dfpwm_dec_frame(struct AVCodecContext *ctx, void *data,
AVFrame *frame = data;
int ret;
- frame->nb_samples = packet->size * 8 / ctx->channels;
+ frame->nb_samples = packet->size * 8 / ctx->ch_layout.nb_channels;
if (frame->nb_samples <= 0) {
av_log(ctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;