From: Brendan McGrath brendan@redmandi.com
--- dlls/mp3dmod/mp3dmod.c | 13 +++++++++++-- dlls/mp3dmod/tests/mp3dmod.c | 19 ++++--------------- 2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c index 830e94353e9..4cdb92ce0b0 100644 --- a/dlls/mp3dmod/mp3dmod.c +++ b/dlls/mp3dmod/mp3dmod.c @@ -313,9 +313,18 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index
static HRESULT WINAPI MediaObject_GetInputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) { - FIXME("(%p)->(%ld, %p) stub!\n", iface, index, type); + struct mp3_decoder *dmo = impl_from_IMediaObject(iface); + TRACE("(%p)->(%ld, %p)\n", iface, index, type);
- return E_NOTIMPL; + if (index) + return DMO_E_INVALIDSTREAMINDEX; + + if (!dmo->intype_set) + return DMO_E_TYPE_NOT_SET; + + MoCopyMediaType(type, &dmo->intype); + + return S_OK; }
static HRESULT WINAPI MediaObject_GetOutputCurrentType(IMediaObject *iface, DWORD index, DMO_MEDIA_TYPE *type) diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c index 8b82e9509af..75ad52c4f21 100644 --- a/dlls/mp3dmod/tests/mp3dmod.c +++ b/dlls/mp3dmod/tests/mp3dmod.c @@ -602,11 +602,9 @@ static void test_media_types(void) ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaObject_GetInputCurrentType(dmo, 1, &mt); - todo_wine ok(hr == DMO_E_INVALIDSTREAMINDEX, "Got hr %#lx.\n", hr);
hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr);
hr = IMediaObject_SetInputType(dmo, 1, &input_mt, DMO_SET_TYPEF_TEST_ONLY); @@ -615,7 +613,6 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#lx.\n", hr);
input_mt.majortype = GUID_NULL; @@ -646,14 +643,10 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
- if (hr == S_OK) - { - check_dmo_media_type(&mt, &input_mt); - MoFreeMediaType(&mt); - } + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt);
for (i = 0; i < 4; ++i) { @@ -688,14 +681,10 @@ static void test_media_types(void) ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IMediaObject_GetInputCurrentType(dmo, 0, &mt); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
- if (hr == S_OK) - { - check_dmo_media_type(&mt, &input_mt); - MoFreeMediaType(&mt); - } + check_dmo_media_type(&mt, &input_mt); + MoFreeMediaType(&mt);
for (i = 0; i < 2; ++i) {