Ulrich Hecht wrote:
Hi!
This fixes sound in Ootake (http://www.ouma.jp/ootake/). Looks like DSBPN_OFFSETSTOP is not always the last element.
- /* 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. */ Don't remove all the comments. They are still mostly valid. Just add that it's not always true for some broken apps.
if (offset == DSBPN_OFFSETSTOP) { if (dsb->state == STATE_STOPPED) { SetEvent(event->hEventNotify); TRACE("signalled event %p (%d)\n", event->hEventNotify, i); - return; - } else - return;
Much better fix and easier to understand would be replacing "returns" for "continue". Then you won't need to reformat the whole block. Something like: @@ -247,9 +247,8 @@ void DSOUND_CheckEvent(const IDirectSoundBufferImpl *dsb, DWORD playpos, int len if (dsb->state == STATE_STOPPED) { SetEvent(event->hEventNotify); TRACE("signalled event %p (%d)\n", event->hEventNotify, i); - return; - } else - return; + } + continue; Vitaliy.
participants (1)
-
Vitaliy Margolen