From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 2 +- dlls/winegstreamer/wma_decoder.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index a97728261b1..d904ecf7e02 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -4032,7 +4032,7 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == E_INVALIDARG, "SetOutputType returned %#lx.\n", hr); ((WAVEFORMATEX *)good_output_type->pbFormat)->nChannels += 1; hr = IMediaObject_SetOutputType(dmo, 0, good_output_type, 0); - todo_wine ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "SetOutputType returned %#lx.\n", hr); + ok(hr == DMO_E_TYPE_NOT_ACCEPTED, "SetOutputType returned %#lx.\n", hr); ((WAVEFORMATEX *)good_output_type->pbFormat)->nChannels -= 1;
/* Test GetOutputCurrentType. */ diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index ddb77724db5..86391200101 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -796,6 +796,16 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde
if (IsEqualGUID(&decoder->input_type.majortype, &GUID_NULL)) return DMO_E_TYPE_NOT_SET; + + if (IsEqualGUID(&decoder->input_type.formattype, &FORMAT_WaveFormatEx) && + IsEqualGUID(&type->formattype, &FORMAT_WaveFormatEx)) + { + WORD current_nchannels = ((WAVEFORMATEX *)decoder->input_type.pbFormat)->nChannels; + WORD incomming_nchannels = ((WAVEFORMATEX *)type->pbFormat)->nChannels; + if (current_nchannels != incomming_nchannels) + return DMO_E_TYPE_NOT_ACCEPTED; + } + if (flags & DMO_SET_TYPEF_TEST_ONLY) return S_OK;