Unified · Split
| @@ -85,7 +85,7 @@ static int xwma_read_header(AVFormatContext *s) · 84 unmodified lines | ||
| 85 | 85 | * 20/48/192kbps are all 20kbps, with the exact same codec data). |
| 86 | 86 | * Decoder needs correct bitrate to work, so it's normalized here. */ |
| 87 | 87 | if (st->codecpar->codec_id == AV_CODEC_ID_WMAV2) { |
| 88 | − int ch = st->codecpar->channels; | |
| 88 | + int ch = st->codecpar->ch_layout.nb_channels; | |
| 89 | 89 | int sr = st->codecpar->sample_rate; |
| 90 | 90 | int br = st->codecpar->bit_rate; |
| 91 | 91 | |
| @@ -146,9 +146,9 @@ static int xwma_read_header(AVFormatContext *s) · 54 unmodified lines | ||
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | − if (!st->codecpar->channels) { | |
| 149 | + if (!av_channel_layout_check(&st->codecpar->ch_layout)) { | |
| 150 | 150 | av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n", |
| 151 | − st->codecpar->channels); | |
| 151 | + st->codecpar->ch_layout.nb_channels); | |
| 152 | 152 | return AVERROR_INVALIDDATA; |
| 153 | 153 | } |
| 154 | 154 | if (!st->codecpar->bits_per_coded_sample) { |
| @@ -236,7 +236,7 @@ static int xwma_read_header(AVFormatContext *s) · 81 unmodified lines | ||
| 236 | 236 | if (dpds_table && dpds_table_size) { |
| 237 | 237 | int64_t cur_pos; |
| 238 | 238 | 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; | |
| 240 | 240 | |
| 241 | 241 | /* Estimate the duration from the total number of output bytes. */ |
| 242 | 242 | 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 | ||
| 244 | 244 | if (!bytes_per_sample) { |
| 245 | 245 | av_log(s, AV_LOG_ERROR, |
| 246 | 246 | "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); | |
| 248 | 248 | ret = AVERROR_INVALIDDATA; |
| 249 | 249 | goto fail; |
| 250 | 250 | } |