Module: wine Branch: master Commit: aad791e9e60aa27af2f2e9f51b688529354fabd0 URL: https://gitlab.winehq.org/wine/wine/-/commit/aad791e9e60aa27af2f2e9f51b68852...
Author: Ziqing Hui zhui@codeweavers.com Date: Fri Nov 18 08:20:28 2022 +0800
winegstreamer: Implement profile_GetStreamByNumber.
---
dlls/winegstreamer/wm_reader.c | 14 ++++++++++++-- dlls/wmvcore/tests/wmvcore.c | 6 ------ 2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 8ac852a99b0..804af4a9aed 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -777,8 +777,18 @@ static HRESULT WINAPI profile_GetStream(IWMProfile3 *iface, DWORD index, IWMStre
static HRESULT WINAPI profile_GetStreamByNumber(IWMProfile3 *iface, WORD stream_number, IWMStreamConfig **config) { - FIXME("iface %p, stream_number %u, config %p, stub!\n", iface, stream_number, config); - return E_NOTIMPL; + HRESULT hr; + + TRACE("iface %p, stream_number %u, config %p.\n", iface, stream_number, config); + + if (!stream_number) + return NS_E_NO_STREAM; + + hr = profile_GetStream(iface, stream_number - 1, config); + if (hr == E_INVALIDARG) + hr = NS_E_NO_STREAM; + + return hr; }
static HRESULT WINAPI profile_RemoveStream(IWMProfile3 *iface, IWMStreamConfig *config) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index a2f92e66e40..874fca81367 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1205,14 +1205,10 @@ static void test_sync_reader_streaming(void) ok(!ref, "Got outstanding refcount %ld.\n", ref);
hr = IWMProfile_GetStreamByNumber(profile, i + 1, &config2); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); - if (hr == S_OK) - { ok(config2 != config, "Expected different objects.\n"); ref = IWMStreamConfig_Release(config2); ok(!ref, "Got outstanding refcount %ld.\n", ref); - }
stream_numbers[i] = 0xdead; hr = IWMStreamConfig_GetStreamNumber(config, &stream_numbers[i]); @@ -1226,10 +1222,8 @@ static void test_sync_reader_streaming(void) hr = IWMProfile_GetStream(profile, 2, &config); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMProfile_GetStreamByNumber(profile, 0, &config); - todo_wine ok(hr == NS_E_NO_STREAM, "Got hr %#lx.\n", hr); hr = IWMProfile_GetStreamByNumber(profile, 3, &config); - todo_wine ok(hr == NS_E_NO_STREAM, "Got hr %#lx.\n", hr);
while (!eos[0] || !eos[1])