summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-10-11 06:52:45 +0400
committermalc <av1474@comtv.ru>2009-10-11 06:52:45 +0400
commit6165a4260b33272b88005ec0cf8538062dc8c834 (patch)
tree99ec1333996baedd7d48b2e271867409cc805880 /audio
parent875ef647b03ba0db7656eaf9da66d1e906f2b38d (diff)
downloadqemu-6165a4260b33272b88005ec0cf8538062dc8c834.tar.gz
winwave: pause/restore playing upon seeing VOICE_DISABLE/ENABLE
Signed-off-by: malc <av1474@comtv.ru>
Diffstat (limited to 'audio')
-rw-r--r--audio/winwaveaudio.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c
index 1486da1b95..f43ae95cf4 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);
}