[FFmpeg-cvslog] wavpackenc: reset trailer info on block encoding

Christophe Gisquet git at videolan.org
Fri Aug 22 20:47:12 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Fri Aug 22 09:31:45 2014 +0000| [4adad5a19ac85de69ced6b1d154344609ff4e493] | committer: Paul B Mahol

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4adad5a19ac85de69ced6b1d154344609ff4e493
---

 libavcodec/wavpackenc.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index 299a035..63971c6 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;
 



More information about the ffmpeg-cvslog mailing list