[vlc-commits] aout: remove aout_mixer_input_t (no functional changes)

Rémi Denis-Courmont git at videolan.org
Tue Jul 26 21:20:00 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 26 22:19:25 2011 +0300| [db0675fac9dba010a92eb04332eaf716f55cc9e3] | committer: Rémi Denis-Courmont

aout: remove aout_mixer_input_t (no functional changes)

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

 include/vlc_aout_mixer.h         |    7 +------
 src/audio_output/aout_internal.h |    2 +-
 src/audio_output/dec.c           |    6 +++---
 src/audio_output/input.c         |   20 ++++++++++----------
 src/audio_output/mixer.c         |    5 ++---
 src/audio_output/output.c        |    2 +-
 6 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/include/vlc_aout_mixer.h b/include/vlc_aout_mixer.h
index 7b3e022..5b7c2da 100644
--- a/include/vlc_aout_mixer.h
+++ b/include/vlc_aout_mixer.h
@@ -40,10 +40,6 @@ extern "C" {
 typedef struct aout_mixer_sys_t aout_mixer_sys_t;
 typedef struct aout_mixer_t aout_mixer_t;
 
-typedef struct {
-    aout_fifo_t fifo;
-} aout_mixer_input_t;
-
 /** 
  * audio output mixer
  */
@@ -59,8 +55,7 @@ struct aout_mixer_t {
      */
     audio_sample_format_t fmt;
 
-    /* Array of mixer inputs */
-    aout_mixer_input_t    *input;
+    aout_fifo_t    *fifo;
 
     /* Mix buffer (mandatory) */
     void (*mix)(aout_mixer_t *, aout_buffer_t *, float);
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index 54a470a..2eacf9d 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -93,7 +93,7 @@ struct aout_input_t
     aout_request_vout_t request_vout;
 
     /* */
-    aout_mixer_input_t mixer;
+    aout_fifo_t       fifo;
  };
 
 /****************************************************************************
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 1509a5a..a8a8ca7 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -231,7 +231,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
 
     if( i_duration != 0 )
     {
-        for( aout_buffer_t *p = p_input->mixer.fifo.p_first; p != NULL; p = p->p_next )
+        for( aout_buffer_t *p = p_input->fifo.p_first; p != NULL; p = p->p_next )
         {
             p->i_pts += i_duration;
         }
@@ -243,7 +243,7 @@ void aout_DecChangePause( audio_output_t *p_aout, aout_input_t *p_input, bool b_
 void aout_DecFlush( audio_output_t *p_aout, aout_input_t *p_input )
 {
     aout_lock( p_aout );
-    aout_FifoSet( &p_input->mixer.fifo, 0 );
+    aout_FifoSet( &p_input->fifo, 0 );
     aout_unlock( p_aout );
 }
 
@@ -252,7 +252,7 @@ bool aout_DecIsEmpty( audio_output_t * p_aout, aout_input_t * p_input )
     mtime_t end_date;
 
     aout_lock( p_aout );
-    end_date = aout_FifoNextStart( &p_input->mixer.fifo );
+    end_date = aout_FifoNextStart( &p_input->fifo );
     aout_unlock( p_aout );
     return end_date <= mdate();
 }
diff --git a/src/audio_output/input.c b/src/audio_output/input.c
index 5e9f772..18e0d92 100644
--- a/src/audio_output/input.c
+++ b/src/audio_output/input.c
@@ -81,7 +81,7 @@ int aout_InputNew( audio_output_t * p_aout, aout_input_t * p_input, const aout_r
     p_input->i_nb_resamplers = p_input->i_nb_filters = 0;
 
     /* Prepare FIFO. */
-    aout_FifoInit( p_aout, &p_input->mixer.fifo, p_aout->mixer_format.i_rate );
+    aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
 
     /* */
     if( p_request_vout )
@@ -446,7 +446,7 @@ int aout_InputDelete( audio_output_t * p_aout, aout_input_t * p_input )
     aout_FiltersDestroyPipeline( p_input->pp_resamplers,
                                  p_input->i_nb_resamplers );
     p_input->i_nb_resamplers = 0;
-    aout_FifoDestroy( &p_input->mixer.fifo );
+    aout_FifoDestroy( &p_input->fifo );
 
     return 0;
 }
@@ -465,16 +465,16 @@ void aout_InputCheckAndRestart( audio_output_t * p_aout, aout_input_t * p_input
 
     /* A little trick to avoid loosing our input fifo and properties */
 
-    aout_fifo_t fifo = p_input->mixer.fifo;
+    aout_fifo_t fifo = p_input->fifo;
     bool b_paused = p_input->b_paused;
     mtime_t i_pause_date = p_input->i_pause_date;
 
-    aout_FifoInit( p_aout, &p_input->mixer.fifo, p_aout->mixer_format.i_rate );
+    aout_FifoInit( p_aout, &p_input->fifo, p_aout->mixer_format.i_rate );
 
     aout_InputDelete( p_aout, p_input );
 
     aout_InputNew( p_aout, p_input, &p_input->request_vout );
-    p_input->mixer.fifo = fifo;
+    p_input->fifo = fifo;
     p_input->b_paused = b_paused;
     p_input->i_pause_date = i_pause_date;
 
@@ -540,7 +540,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
     /* We don't care if someone changes the start date behind our back after
      * this. We'll deal with that when pushing the buffer, and compensate
      * with the next incoming buffer. */
-    start_date = aout_FifoNextStart( &p_input->mixer.fifo );
+    start_date = aout_FifoNextStart( &p_input->fifo );
 
     if ( start_date != 0 && start_date < now )
     {
@@ -549,7 +549,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
          * happen :). */
         msg_Warn( p_aout, "computed PTS is out of range (%"PRId64"), "
                   "clearing out", now - start_date );
-        aout_FifoSet( &p_input->mixer.fifo, 0 );
+        aout_FifoSet( &p_input->fifo, 0 );
         if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
             msg_Warn( p_aout, "timing screwed, stopping resampling" );
         inputResamplingStop( p_input );
@@ -579,7 +579,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
     {
         msg_Warn( p_aout, "buffer way too early (%"PRId64"), clearing queue",
                   drift );
-        aout_FifoSet( &p_input->mixer.fifo, 0 );
+        aout_FifoSet( &p_input->fifo, 0 );
         if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
             msg_Warn( p_aout, "timing screwed, stopping resampling" );
         inputResamplingStop( p_input );
@@ -692,7 +692,7 @@ void aout_InputPlay( audio_output_t * p_aout, aout_input_t * p_input,
 
     /* Adding the start date will be managed by aout_FifoPush(). */
     p_buffer->i_pts = start_date;
-    aout_FifoPush( &p_input->mixer.fifo, p_buffer );
+    aout_FifoPush( &p_input->fifo, p_buffer );
 }
 
 /*****************************************************************************
@@ -709,7 +709,7 @@ static void inputFailure( audio_output_t * p_aout, aout_input_t * p_input,
     aout_FiltersDestroyPipeline( p_input->pp_filters, p_input->i_nb_filters );
     aout_FiltersDestroyPipeline( p_input->pp_resamplers,
                                  p_input->i_nb_resamplers );
-    aout_FifoDestroy( &p_input->mixer.fifo );
+    aout_FifoDestroy( &p_input->fifo );
     var_Destroy( p_aout, "visual" );
     var_Destroy( p_aout, "equalizer" );
     var_Destroy( p_aout, "audio-filter" );
diff --git a/src/audio_output/mixer.c b/src/audio_output/mixer.c
index c881e77..d5c31b1 100644
--- a/src/audio_output/mixer.c
+++ b/src/audio_output/mixer.c
@@ -51,7 +51,7 @@ int aout_MixerNew( audio_output_t * p_aout )
         return VLC_EGENERIC;
 
     p_mixer->fmt = p_aout->mixer_format;
-    p_mixer->input = &p_aout->p_input->mixer;
+    p_mixer->fifo = &p_aout->p_input->fifo;
     p_mixer->mix = NULL;
     p_mixer->sys = NULL;
 
@@ -93,8 +93,7 @@ void aout_MixerDelete( audio_output_t * p_aout )
 static int MixBuffer( audio_output_t * p_aout, float volume )
 {
     aout_mixer_t *p_mixer = p_aout->p_mixer;
-    aout_mixer_input_t *p_input = p_mixer->input;
-    aout_fifo_t *p_fifo = &p_input->fifo;
+    aout_fifo_t *p_fifo = p_mixer->fifo;
     mtime_t now = mdate();
     const unsigned samples = p_aout->i_nb_samples;
     /* FIXME: Remove this silly constraint. Just pass buffers as they come to
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index bde8f10..b7acaa6 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -418,7 +418,7 @@ aout_buffer_t * aout_OutputNextBuffer( audio_output_t * p_aout,
         msg_Warn( p_aout, "output date isn't PTS date, requesting "
                   "resampling (%"PRId64")", delta );
 
-        aout_FifoMoveDates( &p_aout->p_input->mixer.fifo, delta );
+        aout_FifoMoveDates( &p_aout->p_input->fifo, delta );
         aout_FifoMoveDates( p_fifo, delta );
     }
 out:



More information about the vlc-commits mailing list