aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-05-13 11:11:26 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:36 -0300
commitaa6aa2b25ac4e8b3a5cbb5c8a074a9832900c51b (patch)
tree61ac73e2841852579931d963ba5c3c495603431c
parent4e864b4780f271f5c7224d8e530e0b7438b2fe95 (diff)
downloadffmpeg-aa6aa2b25ac4e8b3a5cbb5c8a074a9832900c51b.tar.gz
redspark: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/redspark.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/redspark.c b/libavformat/redspark.c
index eca182c3a7..c6ee22678d 100644
--- a/libavformat/redspark.c
+++ b/libavformat/redspark.c
@@ -97,26 +97,26 @@ static int redspark_read_header(AVFormatContext *s)
st->duration = bytestream2_get_be32u(&gbc) * 14;
redspark->samples_count = 0;
bytestream2_skipu(&gbc, 10);
- par->channels = bytestream2_get_byteu(&gbc);
- if (!par->channels) {
+ par->ch_layout.nb_channels = bytestream2_get_byteu(&gbc);
+ if (!par->ch_layout.nb_channels) {
return AVERROR_INVALIDDATA;
}
- coef_off = 0x54 + par->channels * 8;
+ coef_off = 0x54 + par->ch_layout.nb_channels * 8;
if (bytestream2_get_byteu(&gbc)) // Loop flag
coef_off += 16;
- if (coef_off + par->channels * (32 + 14) > HEADER_SIZE) {
+ if (coef_off + par->ch_layout.nb_channels * (32 + 14) > HEADER_SIZE) {
return AVERROR_INVALIDDATA;
}
- if (ff_alloc_extradata(par, 32 * par->channels)) {
+ if (ff_alloc_extradata(par, 32 * par->ch_layout.nb_channels)) {
return AVERROR_INVALIDDATA;
}
/* Get the ADPCM table */
bytestream2_seek(&gbc, coef_off, SEEK_SET);
- for (i = 0; i < par->channels; i++) {
+ for (i = 0; i < par->ch_layout.nb_channels; i++) {
if (bytestream2_get_bufferu(&gbc, par->extradata + i * 32, 32) != 32) {
return AVERROR_INVALIDDATA;
}
@@ -132,7 +132,7 @@ static int redspark_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecParameters *par = s->streams[0]->codecpar;
RedSparkContext *redspark = s->priv_data;
- uint32_t size = 8 * par->channels;
+ uint32_t size = 8 * par->ch_layout.nb_channels;
int ret;
if (avio_feof(s->pb) || redspark->samples_count == s->streams[0]->duration)