[8/11] winenas.drv & wineesd.drv: Pausing WAVEHDR loops is not an issue for these. (try2)

Francois Gouget fgouget at codeweavers.com
Sat Mar 28 22:14:18 CDT 2009


---

The previous patch had a copy/paste error in winenas.drv.

 dlls/wineesd.drv/audio.c |   17 ++++++-----------
 dlls/winenas.drv/audio.c |   16 ++++++----------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/dlls/wineesd.drv/audio.c b/dlls/wineesd.drv/audio.c
index fd60831..4a01b83 100644
--- a/dlls/wineesd.drv/audio.c
+++ b/dlls/wineesd.drv/audio.c
@@ -910,17 +910,12 @@ static	void	wodPlayer_Reset(WINE_WAVEOUT* wwo, BOOL reset)
         RESET_OMR(&wwo->msgRing);
         LeaveCriticalSection(&wwo->msgRing.msg_crst);
     } else {
-        if (wwo->lpLoopPtr) {
-            /* complicated case, not handled yet (could imply modifying the loop counter */
-            FIXME("Pausing while in loop isn't correctly handled yet, expect strange results\n");
-            wwo->lpPlayPtr = wwo->lpLoopPtr;
-            wwo->dwPartialOffset = 0;
-            wwo->dwWrittenTotal = wwo->dwPlayedTotal; /* this is wrong !!! */
-        } else {
-	    /* the data already written is going to be played, so take */
-	    /* this fact into account here */
-	    wwo->dwPlayedTotal = wwo->dwWrittenTotal;
-        }
+        /* The data already written is going to be played no matter what,
+         * so take this fact into account here. It also means we don't have
+         * to worry about loops since we won't be attempting to move lpPlayPtr
+         * backwards.
+         */
+        wwo->dwPlayedTotal = wwo->dwWrittenTotal;
 	wwo->state = WINE_WS_PAUSED;
     }
 }
diff --git a/dlls/winenas.drv/audio.c b/dlls/winenas.drv/audio.c
index 10d0b73..d2e58a1 100644
--- a/dlls/winenas.drv/audio.c
+++ b/dlls/winenas.drv/audio.c
@@ -758,16 +758,12 @@ static	void	wodPlayer_Reset(WINE_WAVEOUT* wwo, BOOL reset)
         ResetEvent(wwo->msgRing.msg_event);
         LeaveCriticalSection(&wwo->msgRing.msg_crst);
     } else {
-        if (wwo->lpLoopPtr) {
-            /* complicated case, not handled yet (could imply modifying the loop counter */
-            FIXME("Pausing while in loop isn't correctly handled yet, expec strange results\n");
-            wwo->lpPlayPtr = wwo->lpLoopPtr;
-            wwo->WrittenTotal = wwo->PlayedTotal; /* this is wrong !!! */
-        } else {
-	    /* the data already written is going to be played, so take */
-	    /* this fact into account here */
-	    wwo->PlayedTotal = wwo->WrittenTotal;
-        }
+        /* The data already written is going to be played no matter what,
+         * so take this fact into account here. It also means we don't have
+         * to worry about loops since we won't be attempting to move lpPlayPtr
+         * backwards.
+         */
+        wwo->PlayedTotal = wwo->WrittenTotal;
 	wwo->state = WINE_WS_PAUSED;
     }
 }
-- 
1.6.2




More information about the wine-patches mailing list