summaryrefslogtreecommitdiff
path: root/libavcodec/pcm-dvd.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-13 13:41:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-13 13:43:13 +0200
commit3c89ec2816956cb1d51a518a5c4a638aa86749e9 (patch)
tree0c08672f883fac5910b04d0a7c53117449edc120 /libavcodec/pcm-dvd.c
parent126ba688267eaea3bd1a3852e146aeb1237728d3 (diff)
parentd9cdb7d8d6d828bb5497ea3f0fd7edd2f3f6cc30 (diff)
downloadffmpeg-3c89ec2816956cb1d51a518a5c4a638aa86749e9.tar.gz
Merge commit 'd9cdb7d8d6d828bb5497ea3f0fd7edd2f3f6cc30'
* commit 'd9cdb7d8d6d828bb5497ea3f0fd7edd2f3f6cc30': pcm-dvd: Support channel configuration changes Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pcm-dvd.c')
-rw-r--r--libavcodec/pcm-dvd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c
index d9405651ae..a6058f833d 100644
--- a/libavcodec/pcm-dvd.c
+++ b/libavcodec/pcm-dvd.c
@@ -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) {