SHA256
1
0
forked from pool/wine
wine/wine-dsound-notify.patch

48 lines
1.5 KiB
Diff

--- dlls/dsound/mixer.c
+++ dlls/dsound/mixer.c
@@ -238,29 +238,26 @@
offset = event->dwOffset;
TRACE("checking %d, position %d, event = %p\n",
i, offset, event->hEventNotify);
- /* DSBPN_OFFSETSTOP has to be the last element. So this is */
- /* OK. [Inside DirectX, p274] */
- /* */
- /* This also means we can't sort the entries by offset, */
- /* because DSBPN_OFFSETSTOP == -1 */
+ /* DSBPN_OFFSETSTOP is not necessarily the last element. */
if (offset == DSBPN_OFFSETSTOP) {
if (dsb->state == STATE_STOPPED) {
SetEvent(event->hEventNotify);
TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
- return;
- } else
- return;
- }
- if ((playpos + len) >= dsb->buflen) {
- if ((offset < ((playpos + len) % dsb->buflen)) ||
- (offset >= playpos)) {
- TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
- SetEvent(event->hEventNotify);
}
- } else {
- if ((offset >= playpos) && (offset < (playpos + len))) {
- TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
- SetEvent(event->hEventNotify);
+ }
+ else
+ {
+ if ((playpos + len) >= dsb->buflen) {
+ if ((offset < ((playpos + len) % dsb->buflen)) ||
+ (offset >= playpos)) {
+ TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
+ SetEvent(event->hEventNotify);
+ }
+ } else {
+ if ((offset >= playpos) && (offset < (playpos + len))) {
+ TRACE("signalled event %p (%d)\n", event->hEventNotify, i);
+ SetEvent(event->hEventNotify);
+ }
}
}
}