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

Francois Cartegnie git at videolan.org
Wed Mar 22 16:34:40 CET 2017


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 21 11:07:54 2017 +0100| [46c3a5799be97e66c3b1913a3701e0cb84dd4186] | 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/vlc-2.2.git/?a=commit;h=46c3a5799be97e66c3b1913a3701e0cb84dd4186
---

 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 ef865e9..2c0823f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1954,8 +1954,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->audio) )
+    if( p_owner->p_aout &&
+       ( !AOUT_FMTS_IDENTICAL(&p_dec->fmt_out.audio, &p_owner->audio) ||
+         p_dec->fmt_out.i_codec != p_dec->fmt_out.audio.i_format ) )
     {
         audio_output_t *p_aout = p_owner->p_aout;
 



More information about the vlc-commits mailing list