[PATCH v2 2/2] dmime: Reimplement IDirectMusicAudioPath Activate

Michael Stefaniuc mstefani at winehq.org
Thu Mar 26 13:09:26 CDT 2020


From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>

Spotted while working on 34753, its calling Activate with TRUE
but then stops the sound buffer.

The documenation says that it should stop the playback when paramter is FALSE.
https://docs.microsoft.com/en-us/previous-versions/ms808948%28v%3dmsdn.10%29

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
v2: Normalize the application provided BOOL input.


 dlls/dmime/audiopath.c | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/dlls/dmime/audiopath.c b/dlls/dmime/audiopath.c
index 1aadba92ae..078d843d46 100644
--- a/dlls/dmime/audiopath.c
+++ b/dlls/dmime/audiopath.c
@@ -216,21 +216,23 @@ static HRESULT WINAPI IDirectMusicAudioPathImpl_GetObjectInPath (IDirectMusicAud
 	return E_INVALIDARG;
 }
 
-static HRESULT WINAPI IDirectMusicAudioPathImpl_Activate (IDirectMusicAudioPath *iface, BOOL fActivate)
+static HRESULT WINAPI IDirectMusicAudioPathImpl_Activate(IDirectMusicAudioPath *iface, BOOL activate)
 {
-  struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicAudioPath(iface);
-  FIXME("(%p, %d): stub\n", This, fActivate);
-  if (!fActivate) {
-    if (!This->fActive) return S_OK;
-    This->fActive = FALSE;
-  } else {
-    if (This->fActive) return S_OK;
-    This->fActive = TRUE;
-    if (NULL != This->pDSBuffer) {
-      IDirectSoundBuffer_Stop(This->pDSBuffer);
+    struct IDirectMusicAudioPathImpl *This = impl_from_IDirectMusicAudioPath(iface);
+
+    FIXME("(%p, %d): semi-stub\n", This, activate);
+
+    if (!!activate == This->fActive)
+        return S_FALSE;
+
+    if (!activate && This->pDSBuffer) {
+        /* Path is being deactivated */
+        IDirectSoundBuffer_Stop(This->pDSBuffer);
     }
-  }
-  return S_OK;
+
+    This->fActive = !!activate;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI IDirectMusicAudioPathImpl_SetVolume (IDirectMusicAudioPath *iface, LONG lVolume, DWORD dwDuration)
-- 
2.25.1




More information about the wine-devel mailing list