summaryrefslogtreecommitdiff
path: root/doc/examples/decode_audio.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-01-20 17:47:51 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:47 -0300
commitf5ef91e02080316f50d606f5b0b03333bb627ed7 (patch)
treed6338f72a9ee59dfbf29024ae5d5a5aa29d81ce9 /doc/examples/decode_audio.c
parent50e9e11316064ecdee889b18a0b6681a248edcf4 (diff)
doc/examples: convert to new channel layout-API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'doc/examples/decode_audio.c')
-rw-r--r--doc/examples/decode_audio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/examples/decode_audio.c b/doc/examples/decode_audio.c
index 6c2a8ed550..49ad22cba6 100644
--- a/doc/examples/decode_audio.c
+++ b/doc/examples/decode_audio.c
@@ -97,7 +97,7 @@ static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame,
exit(1);
}
for (i = 0; i < frame->nb_samples; i++)
- for (ch = 0; ch < dec_ctx->channels; ch++)
+ for (ch = 0; ch < dec_ctx->ch_layout.nb_channels; ch++)
fwrite(frame->data[ch] + data_size*i, 1, data_size, outfile);
}
}
@@ -215,7 +215,7 @@ int main(int argc, char **argv)
sfmt = av_get_packed_sample_fmt(sfmt);
}
- n_channels = c->channels;
+ n_channels = c->ch_layout.nb_channels;
if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0)
goto end;