[vlc-devel] [RFC PATH 0/3] decoder: who should call aout_FormatPrepare ?

Thomas Guillem thomas at gllm.fr
Wed Sep 21 16:58:53 CEST 2016


There is a crash in mpg123 if the aout is kept between 2 inputs.

The following code:

p_dec->fmt_out.audio.i_bytes_per_frame = p_owner->fmt.audio.i_bytes_per_frame;
p_dec->fmt_out.audio.i_frame_length = p_owner->fmt.audio.i_frame_length;

from aout_udpate_format() won't be called since the aout is not re-created
(identical). As a result, there will be a division by zero in
decoder_NewAudioBuffer().

The problem is quite simple to solve, but I have a question:

Who should be responsible for setting i_bytes_per_frame, and i_frame_length (or
calling aout_FormatPrepare()) ? Decoder modules or the decoder thread ?

Regards,
Thomas Guillem.

Thomas Guillem (3):
  decoder: assert if aout format is not prepared
  mpg123: prepare audio format
  decoder: prepare format in decoder_NewAudioBuffer

 modules/codec/mpg123.c |  1 +
 src/input/decoder.c    | 10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
2.9.3



More information about the vlc-devel mailing list