From 95bf5877f4e5bb9e4b5af9635e296dae68b992b7 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Fri, 31 Mar 2017 19:00:28 +0200 Subject: xwma: convert to new channel layout API Signed-off-by: Vittorio Giovara Signed-off-by: James Almer --- libavformat/xwma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavformat') diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 37ab3a1ec0..c16ff1be63 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s) * 20/48/192kbps are all 20kbps, with the exact same codec data). * Decoder needs correct bitrate to work, so it's normalized here. */ if (st->codecpar->codec_id == AV_CODEC_ID_WMAV2) { - int ch = st->codecpar->channels; + int ch = st->codecpar->ch_layout.nb_channels; int sr = st->codecpar->sample_rate; int br = st->codecpar->bit_rate; @@ -146,9 +146,9 @@ static int xwma_read_header(AVFormatContext *s) } } - if (!st->codecpar->channels) { + if (!av_channel_layout_check(&st->codecpar->ch_layout)) { av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n", - st->codecpar->channels); + st->codecpar->ch_layout.nb_channels); return AVERROR_INVALIDDATA; } if (!st->codecpar->bits_per_coded_sample) { @@ -236,7 +236,7 @@ static int xwma_read_header(AVFormatContext *s) if (dpds_table && dpds_table_size) { int64_t cur_pos; const uint32_t bytes_per_sample - = (st->codecpar->channels * st->codecpar->bits_per_coded_sample) >> 3; + = (st->codecpar->ch_layout.nb_channels * st->codecpar->bits_per_coded_sample) >> 3; /* Estimate the duration from the total number of output bytes. */ const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1]; @@ -244,7 +244,7 @@ static int xwma_read_header(AVFormatContext *s) if (!bytes_per_sample) { av_log(s, AV_LOG_ERROR, "Invalid bits_per_coded_sample %d for %d channels\n", - st->codecpar->bits_per_coded_sample, st->codecpar->channels); + st->codecpar->bits_per_coded_sample, st->codecpar->ch_layout.nb_channels); ret = AVERROR_INVALIDDATA; goto fail; } -- cgit v1.2.3