[PATCH 6/7] wmp: Stub IWMPNetwork get download/buffering progress

Anton Romanov theli.ua at gmail.com
Mon Mar 12 23:34:54 CDT 2018


Signed-off-by: Anton Romanov <theli.ua at gmail.com>
---
 dlls/wmp/player.c      | 22 ++++++++++++++++++----
 dlls/wmp/tests/media.c | 13 +++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c
index d3c67a3820..ddee6667f4 100644
--- a/dlls/wmp/player.c
+++ b/dlls/wmp/player.c
@@ -1130,8 +1130,15 @@ static HRESULT WINAPI WMPNetwork_get_bufferingCount(IWMPNetwork *iface, LONG *pl
 static HRESULT WINAPI WMPNetwork_get_bufferingProgress(IWMPNetwork *iface, LONG *plBufferingProgress)
 {
     WindowsMediaPlayer *This = impl_from_IWMPNetwork(iface);
-    FIXME("(%p)->(%p)\n", This, plBufferingProgress);
-    return E_NOTIMPL;
+    TRACE("(%p)->(%p)\n", This, plBufferingProgress);
+    if (!This->pFilterGraph) {
+        return S_FALSE;
+    }
+    /* Ideally we would use IAMOpenProgress but we don't have it in wine (yet) */
+    FIXME("stub: Returning buffering progress 100\n");
+    *plBufferingProgress = 100;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI WMPNetwork_get_bufferingTime(IWMPNetwork *iface, LONG *plBufferingTime)
@@ -1256,8 +1263,15 @@ static HRESULT WINAPI WMPNetwork_put_maxBandwidth(IWMPNetwork *iface, LONG lMaxB
 static HRESULT WINAPI WMPNetwork_get_downloadProgress(IWMPNetwork *iface, LONG *plDownloadProgress)
 {
     WindowsMediaPlayer *This = impl_from_IWMPNetwork(iface);
-    FIXME("(%p)->(%p)\n", This, plDownloadProgress);
-    return E_NOTIMPL;
+    TRACE("(%p)->(%p)\n", This, plDownloadProgress);
+    if (!This->pFilterGraph) {
+        return S_FALSE;
+    }
+    /* Ideally we would use IAMOpenProgress but we don't have it in wine (yet) */
+    FIXME("stub: Returning download progress 100\n");
+    *plDownloadProgress = 100;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI WMPNetwork_get_encodedFrameRate(IWMPNetwork *iface, LONG *plFrameRate)
diff --git a/dlls/wmp/tests/media.c b/dlls/wmp/tests/media.c
index 4af5078857..9e1853ecfe 100644
--- a/dlls/wmp/tests/media.c
+++ b/dlls/wmp/tests/media.c
@@ -165,8 +165,10 @@ static void test_wmp(void)
     IOleObject *oleobj;
     static DWORD dw = 100;
     IWMPSettings *settings;
+    IWMPNetwork *network;
     DOUBLE duration;
     VARIANT_BOOL vbool;
+    LONG progress;
     IWMPMedia *media;
     static const WCHAR currentPosition[] = {'c','u','r','r','e','n','t','P','o','s','i','t','i','o','n',0};
     BSTR bstrcurrentPosition = SysAllocString(currentPosition);
@@ -247,6 +249,17 @@ static void test_wmp(void)
     ok(hres == S_OK, "IWMPMedia_get_duration failed: %08x\n", hres);
     ok(duration == 0.047, "unexpected value: %f\n", duration);
 
+    network = NULL;
+    hres = IWMPPlayer4_get_network(player4, &network);
+    ok(hres == S_OK, "get_network failed: %08x\n", hres);
+    ok(network != NULL, "network = NULL\n");
+    hres = IWMPNetwork_get_bufferingProgress(network, &progress);
+    ok(hres == S_OK, "IWMPNetwork_get_bufferingProgress failed: %08x\n", hres);
+    ok(progress == 100, "unexpected value: %d\n", progress);
+    hres = IWMPNetwork_get_downloadProgress(network, &progress);
+    ok(hres == S_OK, "IWMPNetwork_get_downloadProgress failed: %08x\n", hres);
+    ok(progress == 100, "unexpected value: %d\n", progress);
+
     SET_EXPECT(OPENSTATE_CHANGE);
     SET_EXPECT(PLAYSTATE_CHANGE);
     hres = IWMPControls_stop(controls);
-- 
2.16.2




More information about the wine-devel mailing list