diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2017-03-31 17:53:51 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:35 -0300 |
commit | f81417a6d2e2a200658c668b8414547a99f3d002 (patch) | |
tree | 7bc611b8ad80c55e73f1db0b9b014dc1dc7dfe4f /libavformat/nuv.c | |
parent | b9298dad940db1ac49658039a99f9308f57019c0 (diff) | |
download | ffmpeg-f81417a6d2e2a200658c668b8414547a99f3d002.tar.gz |
nuv: 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/nuv.c')
-rw-r--r-- | libavformat/nuv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 5f5cc50302..942ad525d5 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -116,10 +116,11 @@ static int get_codec_data(AVFormatContext *s, AVIOContext *pb, AVStream *vst, return AVERROR_INVALIDDATA; } ast->codecpar->bits_per_coded_sample = avio_rl32(pb); - ast->codecpar->channels = avio_rl32(pb); - ast->codecpar->channel_layout = 0; - if (ast->codecpar->channels <= 0) { - av_log(s, AV_LOG_ERROR, "Invalid channels %d\n", ast->codecpar->channels); + av_channel_layout_uninit(&ast->codecpar->ch_layout); + ast->codecpar->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; + ast->codecpar->ch_layout.nb_channels = avio_rl32(pb); + if (ast->codecpar->ch_layout.nb_channels <= 0) { + av_log(s, AV_LOG_ERROR, "Invalid channels %d\n", ast->codecpar->ch_layout.nb_channels); return AVERROR_INVALIDDATA; } @@ -227,8 +228,7 @@ static int nuv_header(AVFormatContext *s) ast->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ast->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; - ast->codecpar->channels = 2; - ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; + ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; ast->codecpar->sample_rate = 44100; ast->codecpar->bit_rate = 2 * 2 * 44100 * 8; ast->codecpar->block_align = 2 * 2; |