From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winegstreamer/wm_reader.c | 14 ++++++++++++-- dlls/wmvcore/tests/wmvcore.c | 10 ---------- 2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 03adea8a318..9b541fe1d96 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -116,8 +116,18 @@ static HRESULT WINAPI output_props_GetMediaType(IWMOutputMediaProps *iface, WM_M
static HRESULT WINAPI output_props_SetMediaType(IWMOutputMediaProps *iface, WM_MEDIA_TYPE *mt) { - FIXME("iface %p, mt %p, stub!\n", iface, mt); - return E_NOTIMPL; + const struct output_props *props = impl_from_IWMOutputMediaProps(iface); + + TRACE("iface %p, mt %p.\n", iface, mt); + + if (!mt) + return E_POINTER; + + if (!IsEqualGUID(&props->mt.majortype, &mt->majortype)) + return E_FAIL; + + FreeMediaType((AM_MEDIA_TYPE *)&props->mt); + return CopyMediaType((AM_MEDIA_TYPE *)&props->mt, (AM_MEDIA_TYPE *)mt); }
static HRESULT WINAPI output_props_GetStreamGroupName(IWMOutputMediaProps *iface, WCHAR *name, WORD *len) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index bbac572acb5..89f27d3fefe 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -1295,12 +1295,10 @@ static void test_sync_reader_types(void) debugstr_guid(&majortype), debugstr_guid(&majortype2));
hr = IWMOutputMediaProps_SetMediaType(output_props, NULL); - todo_wine ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
memset(mt2_buffer, 0, sizeof(mt2_buffer)); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) @@ -1308,7 +1306,6 @@ static void test_sync_reader_types(void) WAVEFORMATEX *format = (WAVEFORMATEX *)mt->pbFormat; init_audio_type(mt2, &MEDIASUBTYPE_IEEE_FLOAT, 32, format->nChannels, format->nSamplesPerSec); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props); todo_wine @@ -1319,7 +1316,6 @@ static void test_sync_reader_types(void) VIDEOINFO *info = (VIDEOINFO *)mt->pbFormat; init_video_type(mt2, &MEDIASUBTYPE_AYUV, 32, &info->rcTarget); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props); todo_wine @@ -1327,7 +1323,6 @@ static void test_sync_reader_types(void) }
hr = IWMOutputMediaProps_SetMediaType(output_props, mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMSyncReader_SetOutputProps(reader, output_number, output_props); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2462,12 +2457,10 @@ static void test_async_reader_types(void) debugstr_guid(&majortype), debugstr_guid(&majortype2));
hr = IWMOutputMediaProps_SetMediaType(output_props, NULL); - todo_wine ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
memset(mt2_buffer, 0, sizeof(mt2_buffer)); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == E_FAIL, "Got hr %#lx.\n", hr);
if (IsEqualGUID(&majortype, &MEDIATYPE_Audio)) @@ -2475,7 +2468,6 @@ static void test_async_reader_types(void) WAVEFORMATEX *format = (WAVEFORMATEX *)mt->pbFormat; init_audio_type(mt2, &MEDIASUBTYPE_IEEE_FLOAT, 32, format->nChannels, format->nSamplesPerSec); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMReader_SetOutputProps(reader, output_number, output_props); todo_wine @@ -2486,7 +2478,6 @@ static void test_async_reader_types(void) VIDEOINFO *info = (VIDEOINFO *)mt->pbFormat; init_video_type(mt2, &MEDIASUBTYPE_AYUV, 32, &info->rcTarget); hr = IWMOutputMediaProps_SetMediaType(output_props, mt2); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMReader_SetOutputProps(reader, output_number, output_props); todo_wine @@ -2494,7 +2485,6 @@ static void test_async_reader_types(void) }
hr = IWMOutputMediaProps_SetMediaType(output_props, mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMReader_SetOutputProps(reader, output_number, output_props); ok(hr == S_OK, "Got hr %#lx.\n", hr);