summaryrefslogtreecommitdiff
path: root/libavformat/xwma.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 19:00:28 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:39 -0300
commit95bf5877f4e5bb9e4b5af9635e296dae68b992b7 (patch)
treecb70ac908ef964c92536cf6c8b93e93efaa7e04d /libavformat/xwma.c
parent9fd38874ea087edb73e52d1af63b4f59cae09e02 (diff)
downloadffmpeg-95bf5877f4e5bb9e4b5af9635e296dae68b992b7.tar.gz
xwma: 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/xwma.c')
-rw-r--r--libavformat/xwma.c10
1 files changed, 5 insertions, 5 deletions
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;
}