OSS hang

Eric Pouech eric.pouech at wanadoo.fr
Sat Dec 14 03:28:37 CST 2002


this patch by Dan Kegel fixes a hang up while finishing playing wave 
files on the OSS driver
A+
-------------- next part --------------
Name:          oss_hang
ChangeLog:     fixed hangup condition at the end of some playback
License:       X11
GenDate:       2002/12/14 09:25:53 UTC
ModifiedFiles: dlls/winmm/wineoss/audio.c
AddedFiles:    
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/wineoss/audio.c,v
retrieving revision 1.66
diff -u -u -r1.66 audio.c
--- dlls/winmm/wineoss/audio.c	10 Dec 2002 19:06:51 -0000	1.66
+++ dlls/winmm/wineoss/audio.c	14 Dec 2002 09:11:24 -0000
@@ -1152,8 +1173,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;
     }
@@ -1221,8 +1246,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-patches mailing list