[vlc-commits] input: decoder: compare audio codec in aout_update_format

Francois Cartegnie git at videolan.org
Tue Mar 21 11:13:23 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 21 11:07:54 2017 +0100| [a917dca7a1c6bfb2ce2f396f4015ce0e0398f101] | committer: Francois Cartegnie

input: decoder: compare audio codec in aout_update_format

Source of undersized buffers on format change.

Since audio format is derived from fmt.i_codec, the update
path is inconsistent, not updating the aout format in case
fmt.i_codec changes (only comparing the derived audio.i_format)

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

 src/input/decoder.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 95f431f..9f95bb8 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -288,8 +288,9 @@ static int aout_update_format( decoder_t *p_dec )
 {
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
 
-    if( p_owner->p_aout
-     && !AOUT_FMTS_IDENTICAL(&p_dec->fmt_out.audio, &p_owner->fmt.audio) )
+    if( p_owner->p_aout &&
+       ( !AOUT_FMTS_IDENTICAL(&p_dec->fmt_out.audio, &p_owner->fmt.audio) ||
+         p_dec->fmt_out.i_codec != p_owner->fmt.i_codec ) )
     {
         audio_output_t *p_aout = p_owner->p_aout;
 



More information about the vlc-commits mailing list