Commit 3c89ec28 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd9cdb7d8'

* commit 'd9cdb7d8':
  pcm-dvd: Support channel configuration changes
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 126ba688 d9cdb7d8
......@@ -47,7 +47,6 @@ static av_cold int pcm_dvd_decode_init(AVCodecContext *avctx)
/* reserve space for 8 channels, 3 bytes/sample, 4 samples/block */
if (!(s->extra_samples = av_malloc(8 * 3 * 4)))
return AVERROR(ENOMEM);
s->extra_sample_count = 0;
return 0;
}
......@@ -81,6 +80,9 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
* header[2] dynamic range control (0x80 = off)
*/
/* Discard potentially existing leftover samples from old channel layout */
s->extra_sample_count = 0;
/* get the sample depth and derive the sample format from it */
avctx->bits_per_coded_sample = 16 + (header[1] >> 6 & 3) * 4;
if (avctx->bits_per_coded_sample == 28) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment