From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 4 ++-- dlls/winegstreamer/wma_decoder.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 87df9adf4dd..3defdb7fa64 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -4086,7 +4086,7 @@ static void test_wma_decoder_dmo_output_type(void) /* Test setting output type to a type with less channels. */ init_dmo_media_type_audio(bad_output_type, &MEDIASUBTYPE_PCM, 1, rate, bits_per_sample); hr = IMediaObject_SetOutputType(dmo, 0, bad_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);
/* Test setting output type to a type with more channels. */ init_dmo_media_type_audio(input_type, input_subtype, 1, rate, 16); @@ -4099,7 +4099,7 @@ static void test_wma_decoder_dmo_output_type(void) ok(hr == S_OK, "SetOutputType returned %#lx.\n", hr); init_dmo_media_type_audio(bad_output_type, &MEDIASUBTYPE_PCM, 2, rate, bits_per_sample); hr = IMediaObject_SetOutputType(dmo, 0, bad_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);
init_dmo_media_type_audio(input_type, input_subtype, channel_count, rate * 2, 32); hr = IMediaObject_SetInputType(dmo, 0, input_type, 0); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index fd046a6ef01..329e07d9831 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -801,6 +801,14 @@ static HRESULT WINAPI media_object_SetOutputType(IMediaObject *iface, DWORD inde if (!IsEqualGUID(&decoder->input_type.formattype, &type->formattype)) return DMO_E_TYPE_NOT_ACCEPTED;
+ if (IsEqualGUID(&decoder->input_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 (FAILED(hr = wg_transform_create_quartz(&decoder->input_type, &decoder->output_type, &attrs, &new_transform))) return hr;