]> git.sesse.net Git - vlc/commitdiff
aout: make flush operation mandatory
authorRémi Denis-Courmont <remi@remlab.net>
Fri, 16 Nov 2012 16:49:50 +0000 (18:49 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Fri, 16 Nov 2012 16:49:50 +0000 (18:49 +0200)
include/vlc_aout.h
modules/audio_output/adummy.c
src/audio_output/output.c

index 21025ae4bba59d65c3d9d41856d7f3a6c279d960..637ad5baeb9efee885ba6e4759e82ccb34cc1de3 100644 (file)
@@ -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.
index 55d4340ef944ccc63e01f4c26d5febcfad102116..a973aed46c1647be6a46811f1cb6c610a707d1e3 100644 (file)
@@ -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;
index 91e9b78b4917a28f1e563badc37cc8a3fc0dcc5f..770df23bdb007b795812318c2fdd39c82209c86f 100644 (file)
@@ -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);
 }