[vlc-commits] decklink: fix build

Rémi Denis-Courmont git at videolan.org
Wed Mar 27 17:32:17 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar 27 18:32:09 2019 +0200| [a83c8cea8fac3e2d4f18e32c0cc49a8aa8e2dd5a] | committer: Rémi Denis-Courmont

decklink: fix build

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

 modules/video_output/decklink.cpp | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index 2d001868d8..8455aefedc 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -1075,7 +1075,7 @@ static void CloseVideo(vlc_object_t *p_this)
  * Audio
  *****************************************************************************/
 
-static void Flush (audio_output_t *aout, bool drain)
+static void Flush(audio_output_t *aout)
 {
     decklink_sys_t *sys = (decklink_sys_t *) aout->sys;
     vlc_mutex_lock(&sys->lock);
@@ -1084,14 +1084,25 @@ static void Flush (audio_output_t *aout, bool drain)
     if (!p_output)
         return;
 
-    if (drain) {
-        uint32_t samples;
-        sys->p_output->GetBufferedAudioSampleFrameCount(&samples);
-        vlc_tick_sleep(vlc_tick_from_samples(samples, sys->i_rate));
-    } else if (sys->p_output->FlushBufferedAudioSamples() == E_FAIL)
+    if (sys->p_output->FlushBufferedAudioSamples() == E_FAIL)
         msg_Err(aout, "Flush failed");
 }
 
+static void Drain(audio_output_t *aout)
+{
+    decklink_sys_t *sys = (decklink_sys_t *) aout->sys;
+    vlc_mutex_lock(&sys->lock);
+    IDeckLinkOutput *p_output = sys->p_output;
+    vlc_mutex_unlock(&sys->lock);
+    if (!p_output)
+        return;
+
+    uint32_t samples;
+    sys->p_output->GetBufferedAudioSampleFrameCount(&samples);
+    vlc_tick_sleep(vlc_tick_from_samples(samples, sys->i_rate));
+}
+
+
 static int TimeGet(audio_output_t *, vlc_tick_t* restrict)
 {
     /* synchronization is handled by the card */
@@ -1160,6 +1171,7 @@ static int OpenAudio(vlc_object_t *p_this)
     aout->play      = PlayAudio;
     aout->start     = Start;
     aout->flush     = Flush;
+    aout->drain     = Drain;
     aout->time_get  = TimeGet;
 
     aout->pause     = aout_PauseDefault;



More information about the vlc-commits mailing list