aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
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:38 -0300
commitf799b6e23c3c78444250efa9d54af0d93cdd95c3 (patch)
tree7b4de2f5fdc8d22c50cc8acdd665e92081fabcea /libavformat
parent15c6547829e65cc2dda2bfc15d33cf24d238a684 (diff)
downloadffmpeg-f799b6e23c3c78444250efa9d54af0d93cdd95c3.tar.gz
vividas: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/vividas.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index d7a6e74650..e9954f73ed 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -372,9 +372,9 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t *
avio_r8(pb); // '5'
avio_r8(pb); //codec_id
avio_rl16(pb); //codec_subid
- st->codecpar->channels = avio_rl16(pb); // channels
+ st->codecpar->ch_layout.nb_channels = avio_rl16(pb); // channels
st->codecpar->sample_rate = avio_rl32(pb); // sample_rate
- if (st->codecpar->sample_rate <= 0 || st->codecpar->channels <= 0)
+ if (st->codecpar->sample_rate <= 0 || st->codecpar->ch_layout.nb_channels <= 0)
return AVERROR_INVALIDDATA;
avio_seek(pb, 10, SEEK_CUR); // data_1
q = avio_r8(pb);
@@ -655,7 +655,8 @@ static int viv_read_packet(AVFormatContext *s,
astream = s->streams[pkt->stream_index];
pkt->pts = av_rescale_q(viv->audio_sample, av_make_q(1, astream->codecpar->sample_rate), astream->time_base);
- viv->audio_sample += viv->audio_subpackets[viv->current_audio_subpacket].pcm_bytes / 2 / astream->codecpar->channels;
+ viv->audio_sample += viv->audio_subpackets[viv->current_audio_subpacket].pcm_bytes / 2 /
+ astream->codecpar->ch_layout.nb_channels;
pkt->flags |= AV_PKT_FLAG_KEY;
viv->current_audio_subpacket++;
return 0;