[vlc-commits] aout: provide a default implementation for pause

Rémi Denis-Courmont git at videolan.org
Sat Nov 17 17:21:08 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Nov 17 18:07:01 2012 +0200| [ba6c9da0f76428a6fdfc8f1049a6682cade0f51a] | committer: Rémi Denis-Courmont

aout: provide a default implementation for pause

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

 src/audio_output/output.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 770df23..ce40ec9 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -424,6 +424,13 @@ void aout_OutputPlay (audio_output_t *aout, block_t *block)
     aout->play (aout, block);
 }
 
+static void PauseDefault (audio_output_t *aout, bool pause, mtime_t date)
+{
+    if (pause)
+        aout_OutputFlush (aout, false);
+    (void) date;
+}
+
 /**
  * Notifies the audio output (if any) of pause/resume events.
  * This enables the output to expedite pause, instead of waiting for its
@@ -433,9 +440,8 @@ void aout_OutputPlay (audio_output_t *aout, block_t *block)
  */
 void aout_OutputPause( audio_output_t *aout, bool pause, mtime_t date )
 {
-    aout_assert_locked( aout );
-    if( aout->pause != NULL )
-        aout->pause( aout, pause, date );
+    aout_assert_locked (aout);
+    ((aout->pause != NULL) ? aout->pause : PauseDefault) (aout, pause, date);
 }
 
 /**



More information about the vlc-commits mailing list