aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/xvag.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 19:01:03 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:39 -0300
commit4f7c45208e46943cf60a45827114fdf626f45898 (patch)
treeb449f14d8dbb4803c95d5e420ceda0ba7b7bde28 /libavformat/xvag.c
parentfdfbc47a0db8e6f3bc6cf5e9dce7c55925392f2f (diff)
downloadffmpeg-4f7c45208e46943cf60a45827114fdf626f45898.tar.gz
xvag: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/xvag.c')
-rw-r--r--libavformat/xvag.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/xvag.c b/libavformat/xvag.c
index 994b710f8d..f8a83f258c 100644
--- a/libavformat/xvag.c
+++ b/libavformat/xvag.c
@@ -52,7 +52,7 @@ static int xvag_read_header(AVFormatContext *s)
offset = av_bswap32(offset);
avio_skip(s->pb, 28);
codec = avio_rb32(s->pb);
- st->codecpar->channels = avio_rb32(s->pb);
+ st->codecpar->ch_layout.nb_channels = avio_rb32(s->pb);
avio_skip(s->pb, 4);
st->duration = avio_rb32(s->pb);
avio_skip(s->pb, 8);
@@ -60,7 +60,7 @@ static int xvag_read_header(AVFormatContext *s)
} else {
avio_skip(s->pb, 28);
codec = avio_rl32(s->pb);
- st->codecpar->channels = avio_rl32(s->pb);
+ st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb);
avio_skip(s->pb, 4);
st->duration = avio_rl32(s->pb);
avio_skip(s->pb, 8);
@@ -69,13 +69,14 @@ static int xvag_read_header(AVFormatContext *s)
if (st->codecpar->sample_rate <= 0)
return AVERROR_INVALIDDATA;
- if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS)
+ if (st->codecpar->ch_layout.nb_channels <= 0 ||
+ st->codecpar->ch_layout.nb_channels > FF_SANE_NB_CHANNELS)
return AVERROR_INVALIDDATA;
switch (codec) {
case 0x1c:
st->codecpar->codec_id = AV_CODEC_ID_ADPCM_PSX;
- st->codecpar->block_align = 16 * st->codecpar->channels;
+ st->codecpar->block_align = 16 * st->codecpar->ch_layout.nb_channels;
break;
default:
avpriv_request_sample(s, "codec %X", codec);