summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-08-22 09:31:45 +0000
committerPaul B Mahol <onemda@gmail.com>2014-08-22 18:44:16 +0000
commit4adad5a19ac85de69ced6b1d154344609ff4e493 (patch)
tree95e6084986c972c17feb3aa90788663d03a8e068 /libavcodec
parenta59f85d1064d5eeea9c0d6a4db8d0f4f76605d93 (diff)
wavpackenc: reset trailer info on block encoding
In some cases, in particular if several blocks are needed because of the channel layout (e.g. 2.1), the information used to write the trailing bits terminating the sample data was not reset. This would cause potential desync on the decoder, although decoded samples were actually mostly fine. Fixes ticket #3879.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/wavpackenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 299a035fc5..63971c6755 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -2487,6 +2487,9 @@ static int wavpack_encode_block(WavPackEncodeContext *s,
struct Decorr *dpp;
PutByteContext pb;
+ if (s->flags & WV_MONO_DATA) {
+ CLEAR(s->w);
+ }
if (!(s->flags & WV_MONO) && s->optimize_mono) {
int32_t lor = 0, diff = 0;