=?UTF-8?Q?J=C3=B6rg=20H=C3=B6hle=20?=: winealsa: Stop may not use snd_pcm_drop or lose written frames.

Alexandre Julliard julliard at winehq.org
Thu Jan 12 13:19:23 CST 2012


Module: wine
Branch: master
Commit: 77e01019c5ceb7fd2389764328a10903a99fb1c5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=77e01019c5ceb7fd2389764328a10903a99fb1c5

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Tue Nov 15 10:18:39 2011 +0100

winealsa: Stop may not use snd_pcm_drop or lose written frames.

---

 dlls/winealsa.drv/mmdevdrv.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c
index e791feb..8e79c6e 100644
--- a/dlls/winealsa.drv/mmdevdrv.c
+++ b/dlls/winealsa.drv/mmdevdrv.c
@@ -1718,14 +1718,9 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface)
         return S_FALSE;
     }
 
-    if(snd_pcm_drop(This->pcm_handle) < 0)
-        WARN("snd_pcm_drop failed\n");
-
-    if(snd_pcm_reset(This->pcm_handle) < 0)
-        WARN("snd_pcm_reset failed\n");
-
-    if(snd_pcm_prepare(This->pcm_handle) < 0)
-        WARN("snd_pcm_prepare failed\n");
+    /* Stop without losing written frames or position.
+     * snd_pcm_pause would be appropriate but is unsupported by dmix.
+     * snd_pcm_drain yields EAGAIN in NONBLOCK mode, except with Pulse. */
 
     event = CreateEventW(NULL, TRUE, FALSE, NULL);
     wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event);




More information about the wine-cvs mailing list