[vlc-commits] codec: faad: add guard for audio junk

Francois Cartegnie git at videolan.org
Mon Mar 6 17:31:36 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar  6 17:31:05 2017 +0100| [d21822f527d8dfaff45f9915c9ddd4b5ff82635d] | committer: Francois Cartegnie

codec: faad: add guard for audio junk

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d21822f527d8dfaff45f9915c9ddd4b5ff82635d
---

 modules/codec/faad.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index d8a3a0f..717b2b0 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -472,6 +472,10 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
                                               frame.samples / frame.channels )
                               - p_out->i_pts;
 
+            /* Don't kill speakers if some weird mapping does not gets 1:1 */
+            if( popcount(p_dec->fmt_out.audio.i_physical_channels) != frame.channels )
+                memset( p_out->p_buffer, 0, p_out->i_buffer );
+
             /* FIXME: replace when aout_channel_reorder can take samples from a different buffer */
             DoReordering( (uint32_t *)p_out->p_buffer, samples,
                           frame.samples / frame.channels, frame.channels,



More information about the vlc-commits mailing list