qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 6165a42] winwave: pause/restore playing upon seei


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 6165a42] winwave: pause/restore playing upon seeingVOICE_DISABLE/ENABLE
Date: Sun, 11 Oct 2009 02:53:55 -0000

From: malc <address@hidden>

Signed-off-by: malc <address@hidden>

diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c
index 1486da1..f43ae95 100644
--- a/audio/winwaveaudio.c
+++ b/audio/winwaveaudio.c
@@ -29,6 +29,7 @@ typedef struct {
     int avail;
     int pending;
     int curhdr;
+    int paused;
     CRITICAL_SECTION crit_sect;
 } WaveVoiceOut;
 
@@ -282,6 +283,7 @@ static void winwave_fini_out (HWVoiceOut *hw)
 
 static int winwave_ctl_out (HWVoiceOut *hw, int cmd, ...)
 {
+    MMRESULT mr;
     WaveVoiceOut *wave = (WaveVoiceOut *) hw;
 
     switch (cmd) {
@@ -313,10 +315,26 @@ static int winwave_ctl_out (HWVoiceOut *hw, int cmd, ...)
             else {
                 hw->poll_mode = 0;
             }
+            if (wave->paused) {
+                mr = waveOutRestart (wave->hwo);
+                if (mr != MMSYSERR_NOERROR) {
+                    winwave_logerr (mr, "waveOutRestart");
+                }
+                wave->paused = 0;
+            }
         }
         return 0;
 
     case VOICE_DISABLE:
+        if (!wave->paused) {
+            mr = waveOutPause (wave->hwo);
+            if (mr != MMSYSERR_NOERROR) {
+                winwave_logerr (mr, "waveOutPause");
+            }
+            else {
+                wave->paused = 1;
+            }
+        }
         if (wave->event) {
             qemu_del_wait_object (wave->event, winwave_poll_out, wave);
         }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]