History

xwma: convert to new channel layout API

Vittorio Giovara committed 9 years ago

Commit 95bf5871 parent 9fd38871 file · +5 −5Browse files

Unified · Split

libavformat/xwma.c+5−5
@@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s) · 84 unmodified lines
8585 * 20/48/192kbps are all 20kbps, with the exact same codec data).
8686 * Decoder needs correct bitrate to work, so it's normalized here. */
8787 if (st->codecpar->codec_id == AV_CODEC_ID_WMAV2) {
88− int ch = st->codecpar->channels;
88+ int ch = st->codecpar->ch_layout.nb_channels;
8989 int sr = st->codecpar->sample_rate;
9090 int br = st->codecpar->bit_rate;
9191
@@ -146,9 +146,9 @@ static int xwma_read_header(AVFormatContext *s) · 54 unmodified lines
146146 }
147147 }
148148
149− if (!st->codecpar->channels) {
149+ if (!av_channel_layout_check(&st->codecpar->ch_layout)) {
150150 av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n",
151− st->codecpar->channels);
151+ st->codecpar->ch_layout.nb_channels);
152152 return AVERROR_INVALIDDATA;
153153 }
154154 if (!st->codecpar->bits_per_coded_sample) {
@@ -236,7 +236,7 @@ static int xwma_read_header(AVFormatContext *s) · 81 unmodified lines
236236 if (dpds_table && dpds_table_size) {
237237 int64_t cur_pos;
238238 const uint32_t bytes_per_sample
239− = (st->codecpar->channels * st->codecpar->bits_per_coded_sample) >> 3;
239+ = (st->codecpar->ch_layout.nb_channels * st->codecpar->bits_per_coded_sample) >> 3;
240240
241241 /* Estimate the duration from the total number of output bytes. */
242242 const uint64_t total_decoded_bytes = dpds_table[dpds_table_size - 1];
@@ -244,7 +244,7 @@ static int xwma_read_header(AVFormatContext *s) · 1 unmodified line
244244 if (!bytes_per_sample) {
245245 av_log(s, AV_LOG_ERROR,
246246 "Invalid bits_per_coded_sample %d for %d channels\n",
247− st->codecpar->bits_per_coded_sample, st->codecpar->channels);
247+ st->codecpar->bits_per_coded_sample, st->codecpar->ch_layout.nb_channels);
248248 ret = AVERROR_INVALIDDATA;
249249 goto fail;
250250 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t