dsound: Reset state when stopping device.
This commit is contained in:
parent
237b293829
commit
de9cecaaa8
|
@ -316,6 +316,13 @@ HRESULT DSOUND_PrimaryStop(DirectSoundDevice *device)
|
||||||
(LPVOID)&(device->hwbuf));
|
(LPVOID)&(device->hwbuf));
|
||||||
if (err != DS_OK)
|
if (err != DS_OK)
|
||||||
WARN("IDsDriver_CreateSoundBuffer failed\n");
|
WARN("IDsDriver_CreateSoundBuffer failed\n");
|
||||||
|
else if (device->state == STATE_STOPPING)
|
||||||
|
device->state = STATE_STOPPED;
|
||||||
|
else if (device->state == STATE_PLAYING)
|
||||||
|
device->state = STATE_STARTING;
|
||||||
|
if (err == DS_OK)
|
||||||
|
FillMemory(device->buffer, device->buflen, (device->pwfx->wBitsPerSample == 8) ? 128 : 0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
WARN("waveOutOpen failed\n");
|
WARN("waveOutOpen failed\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue