[vlc-commits] Fix infinite mixing loop with dummy audio output

Rémi Denis-Courmont git at videolan.org
Fri Jul 8 18:23:15 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul  8 19:22:47 2011 +0300| [df08e998a603fbf0985f6acec33f355e1a5de893] | committer: Rémi Denis-Courmont

Fix infinite mixing loop with dummy audio output

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

 modules/misc/dummy/aout.c |    2 +-
 src/audio_output/mixer.c  |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/misc/dummy/aout.c b/modules/misc/dummy/aout.c
index 8a4e031..1f3f619 100644
--- a/modules/misc/dummy/aout.c
+++ b/modules/misc/dummy/aout.c
@@ -57,13 +57,13 @@ int OpenAudio ( vlc_object_t * p_this )
      && var_InheritBool( p_this, "spdif" ) )
     {
         p_aout->output.output.i_format = VLC_CODEC_SPDIFL;
-        p_aout->output.i_nb_samples = A52_FRAME_NB;
         p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
         p_aout->output.output.i_frame_length = A52_FRAME_NB;
     }
     else
         p_aout->output.output.i_format =
             HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
+    p_aout->output.i_nb_samples = A52_FRAME_NB;
 
     /* Create the variable for the audio-device */
     var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
diff --git a/src/audio_output/mixer.c b/src/audio_output/mixer.c
index 424f42c..0e1b817 100644
--- a/src/audio_output/mixer.c
+++ b/src/audio_output/mixer.c
@@ -98,6 +98,9 @@ static int MixBuffer( aout_instance_t * p_aout, float volume )
     aout_fifo_t *p_fifo = &p_input->fifo;
     mtime_t now = mdate();
     const unsigned samples = p_aout->output.i_nb_samples;
+    /* FIXME: Remove this silly constraint. Just pass buffers as they come to
+     * "smart" audio outputs. */
+    assert( samples > 0 );
 
     aout_lock_input_fifos( p_aout );
     aout_lock_output_fifo( p_aout );



More information about the vlc-commits mailing list