diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 18:49:12 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:38 -0300 |
commit | a3129027eb833cf2483301f2b98704acf8274915 (patch) | |
tree | 4c110a926ea73b33791c827c8125ba36d064c989 /libavformat/vocenc.c | |
parent | 7591de37e6b38189396d0dec43549e029847bf48 (diff) | |
download | ffmpeg-a3129027eb833cf2483301f2b98704acf8274915.tar.gz |
voc: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/vocenc.c')
-rw-r--r-- | libavformat/vocenc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c index 798b463a82..59c2bbba7b 100644 --- a/libavformat/vocenc.c +++ b/libavformat/vocenc.c @@ -63,16 +63,17 @@ static int voc_write_packet(AVFormatContext *s, AVPacket *pkt) avio_wl24(pb, pkt->size + 12); avio_wl32(pb, par->sample_rate); avio_w8(pb, par->bits_per_coded_sample); - avio_w8(pb, par->channels); + avio_w8(pb, par->ch_layout.nb_channels); avio_wl16(pb, par->codec_tag); avio_wl32(pb, 0); } else { - if (s->streams[0]->codecpar->channels > 1) { + if (s->streams[0]->codecpar->ch_layout.nb_channels > 1) { avio_w8(pb, VOC_TYPE_EXTENDED); avio_wl24(pb, 4); - avio_wl16(pb, 65536-(256000000 + par->sample_rate*par->channels/2)/(par->sample_rate*par->channels)); + avio_wl16(pb, 65536 - (256000000 + par->sample_rate * par->ch_layout.nb_channels / 2) / + (par->sample_rate * par->ch_layout.nb_channels)); avio_w8(pb, par->codec_tag); - avio_w8(pb, par->channels - 1); + avio_w8(pb, par->ch_layout.nb_channels - 1); } avio_w8(pb, VOC_TYPE_VOICE_DATA); avio_wl24(pb, pkt->size + 2); |