[patch] revert part of Aug 26 change in winmm/wineoss/audio.c that broke msvc++4.0 installer?

Eric Pouech eric.pouech at wanadoo.fr
Wed Dec 11 14:26:01 CST 2002


>>> Can someone who understands the code comment?
>>
>> I don't, never looked at audio code before, but the above has two 
>> changes:
>>
>> The condition has the '2 *' bit in it, and the body of the if has
>> +        wwo->dwPlayedTotal = wwo->dwWrittenTotal;
>> The TRACEs are noops, can be ignored.
>>
>> So I suggest trying them out individually, to see which one
>> causes the problem (or maybe they can not be separated). 
>> Experimentation will tell. :)
> 
> 
> I tried each individually, and neither helped.  Only the two
> changes together yielded a wine that properly terminated
> when I clicked on the "Exit" button in msvc4++'s installer.
> - Dan

a more complete fix should be included
could you try if it works fine ?

A+
-------------- next part --------------
Index: dlls/winmm/wineoss/audio.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/wineoss/audio.c,v
retrieving revision 1.65
diff -u -r1.65 audio.c
--- dlls/winmm/wineoss/audio.c	4 Nov 2002 22:39:19 -0000	1.65
+++ dlls/winmm/wineoss/audio.c	11 Dec 2002 20:21:45 -0000
@@ -1147,8 +1171,12 @@
     TRACE("fragments=%d/%d, fragsize=%d, bytes=%d\n",
 	  dspspace.fragments, dspspace.fragstotal, dspspace.fragsize, dspspace.bytes);
 
-    /* input queue empty and output buffer with less than one fragment to play */
-    if (!wwo->lpPlayPtr && wwo->dwBufferSize < availInQ + wwo->dwFragmentSize) {
+    /* input queue empty and output buffer with less than one fragment to play 
+     * actually some cards do not play the fragment before the last if this one is partially feed
+     * so we need to test for full the availability of 2 fragments
+     */
+    if (!wwo->lpPlayPtr && wwo->dwBufferSize < availInQ + 2 * wwo->dwFragmentSize && 
+        !wwo->bNeedPost) {
 	TRACE("Run out of wavehdr:s...\n");
         return INFINITE;
     }
@@ -1216,8 +1244,8 @@
 		    TRACE("flushing\n");
 		    ioctl(wwo->ossdev->fd, SNDCTL_DSP_SYNC, 0);
 		    wwo->dwPlayedTotal = wwo->dwWrittenTotal;
-		}
-		else {
+                    dwNextNotifyTime = wodPlayer_NotifyCompletions(wwo, FALSE);
+		} else {
 		    TRACE("recovering\n");
 		    dwNextFeedTime = wodPlayer_FeedDSP(wwo);
 		}


More information about the wine-devel mailing list