[vlc-commits] mmdevice: emulate drain
Rémi Denis-Courmont
git at videolan.org
Wed Dec 5 22:46:49 CET 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 5 23:46:09 2012 +0200| [76425f762b8290c9a85987708b051a069065ead0] | committer: Rémi Denis-Courmont
mmdevice: emulate drain
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=76425f762b8290c9a85987708b051a069065ead0
---
modules/audio_output/mmdevice.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/modules/audio_output/mmdevice.c b/modules/audio_output/mmdevice.c
index 053deb9..2ae4f8e 100644
--- a/modules/audio_output/mmdevice.c
+++ b/modules/audio_output/mmdevice.c
@@ -151,15 +151,24 @@ static void Pause(audio_output_t *aout, bool paused, mtime_t date)
static void Flush(audio_output_t *aout, bool wait)
{
aout_sys_t *sys = aout->sys;
-
- if (wait)
- return; /* Drain not implemented */
+ mtime_t delay = VLC_TS_INVALID;
EnterMTA();
EnterCriticalSection(&sys->lock);
- aout_api_Flush(sys->api);
+
+ if (wait)
+ { /* Loosy drain emulation */
+ if (FAILED(aout_api_TimeGet(sys->api, &delay)))
+ delay = VLC_TS_INVALID;
+ }
+ else
+ aout_api_Flush(sys->api);
+
LeaveCriticalSection(&sys->lock);
LeaveMTA();
+
+ if (delay != VLC_TS_INVALID)
+ Sleep((delay / (CLOCK_FREQ / 1000)) + 1);
}
static ISimpleAudioVolume *GetSimpleVolume(audio_output_t *aout)
More information about the vlc-commits
mailing list