From f81417a6d2e2a200658c668b8414547a99f3d002 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Fri, 31 Mar 2017 17:53:51 +0200 Subject: [PATCH] nuv: convert to new channel layout API Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/nuv.c | 12 ++++++------ 1 file 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;