[PATCH 32/32] mciqtz: Fix mciPlay

Maarten Lankhorst m.b.lankhorst at gmail.com
Mon Jul 26 08:55:11 CDT 2010


---
 dlls/mciqtz32/mciqtz.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c
index 3474685..921d077 100644
--- a/dlls/mciqtz32/mciqtz.c
+++ b/dlls/mciqtz32/mciqtz.c
@@ -294,6 +294,9 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
 {
     WINE_MCIQTZ* wma;
     HRESULT hr;
+    REFERENCE_TIME time1 = 0, time2 = 0;
+    GUID format;
+    DWORD pos1;
 
     TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
 
@@ -304,6 +307,24 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
     if (!wma)
         return MCIERR_INVALID_DEVICE_ID;
 
+    IMediaSeeking_GetTimeFormat(wma->seek, &format);
+    if (dwFlags & MCI_FROM) {
+        if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
+            time1 = lpParms->dwFrom * 10000;
+        else
+            time1 = lpParms->dwFrom;
+        pos1 = AM_SEEKING_AbsolutePositioning;
+    } else
+        pos1 = AM_SEEKING_NoPositioning;
+    if (dwFlags & MCI_TO) {
+        if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
+            time2 = lpParms->dwTo * 10000;
+        else
+            time2 = lpParms->dwTo;
+    } else
+        IMediaSeeking_GetDuration(wma->seek, &time2);
+    IMediaSeeking_SetPositions(wma->seek, &time1, pos1, &time2, AM_SEEKING_AbsolutePositioning);
+
     hr = IMediaControl_Run(wma->pmctrl);
     if (FAILED(hr)) {
         TRACE("Cannot run filtergraph (hr = %x)\n", hr);
@@ -313,6 +334,8 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
     if (!wma->parent)
         IVideoWindow_put_Visible(wma->vidwin, OATRUE);
 
+    if (dwFlags & MCI_NOTIFY)
+        mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), wDevID, MCI_NOTIFY_SUCCESSFUL);
     return 0;
 }
 
-- 
1.7.0.4


--------------010100060604060009070304--



More information about the wine-patches mailing list