[vlc-commits] aout: make flush operation mandatory

Rémi Denis-Courmont git at videolan.org
Fri Nov 16 17:50:02 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 16 18:49:50 2012 +0200| [024ca98d52d2f0003677c8e942f53e86c98e0ae5] | committer: Rémi Denis-Courmont

aout: make flush operation mandatory

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

 include/vlc_aout.h            |    2 +-
 modules/audio_output/adummy.c |    7 ++++++-
 src/audio_output/output.c     |    4 +---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index 21025ae..637ad5b 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -169,7 +169,7 @@ struct audio_output
       * \note A stream must have been started when called.
       */
     void (*flush)( audio_output_t *, bool wait);
-    /**< Flushes or drains the playback buffers (optional, may be NULL).
+    /**< Flushes or drains the playback buffers (mandatoryl, cannot be NULL).
       * \param wait true to wait for playback of pending buffers (drain),
       *             false to discard pending buffers (flush)
       * \note A stream must have been started when called.
diff --git a/modules/audio_output/adummy.c b/modules/audio_output/adummy.c
index 55d4340..a973aed 100644
--- a/modules/audio_output/adummy.c
+++ b/modules/audio_output/adummy.c
@@ -48,6 +48,11 @@ static void Play(audio_output_t *aout, block_t *block)
     (void) aout;
 }
 
+static void Flush(audio_output_t *aout, bool wait)
+{
+    (void) aout; (void) wait;
+}
+
 static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
 {
     if (AOUT_FMT_SPDIF(fmt) && var_InheritBool(aout, "spdif"))
@@ -70,7 +75,7 @@ static int Open(vlc_object_t *obj)
     aout->time_get = NULL;
     aout->play = Play;
     aout->pause = NULL;
-    aout->flush = NULL;
+    aout->flush = Flush;
     aout->stop = NULL;
     aout->volume_set = NULL;
     aout->mute_set = NULL;
diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 91e9b78..770df23 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -449,7 +449,5 @@ void aout_OutputPause( audio_output_t *aout, bool pause, mtime_t date )
 void aout_OutputFlush( audio_output_t *aout, bool wait )
 {
     aout_assert_locked( aout );
-
-    if( aout->flush != NULL )
-        aout->flush( aout, wait );
+    aout->flush (aout, wait);
 }



More information about the vlc-commits mailing list