winegstreamer: Reject incompatible output types in MPEG layer-3 decoder.

Signed-off-by: Anton Baskanov <baskanov@gmail.com>
This commit is contained in:
Anton Baskanov 2022-10-02 20:07:58 +07:00 committed by Alexandre Julliard
parent f114e2d354
commit 1d636da205
2 changed files with 10 additions and 3 deletions

View file

@ -767,7 +767,7 @@ static void test_media_types(void)
init_pcm_mt(&mt, &format, 1, 32000, 16);
hr = IPin_QueryAccept(pin, &mt);
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
IPin_Release(pin);
@ -928,12 +928,12 @@ static void test_connect_pin(void)
init_pcm_mt(&req_mt, &req_format, 1, 32000, 16);
req_mt.majortype = GUID_NULL;
hr = IPin_QueryAccept(source, &req_mt);
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
init_pcm_mt(&req_mt, &req_format, 1, 32000, 16);
req_mt.subtype = GUID_NULL;
hr = IPin_QueryAccept(source, &req_mt);
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
hr = IMediaControl_Pause(control);
ok(hr == S_OK, "Got hr %#lx.\n", hr);

View file

@ -754,6 +754,13 @@ static HRESULT mpeg_layer3_decoder_sink_query_accept(struct transform *filter, c
static HRESULT mpeg_layer3_decoder_source_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt)
{
if (!filter->sink.pin.peer)
return S_FALSE;
if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio)
|| !IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_PCM))
return S_FALSE;
return S_OK;
}