dsound: notification order

Vitaliy Margolen wine-devel at kievinfo.com
Wed Jun 11 08:58:35 CDT 2008


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.



More information about the wine-devel mailing list