mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 02:44:46 +00:00
winegstreamer: Reject incompatible input media types in MPEG layer-3 decoder.
Signed-off-by: Anton Baskanov <baskanov@gmail.com>
This commit is contained in:
parent
fea3691aea
commit
4489c31b3d
|
@ -707,23 +707,23 @@ static void test_media_types(void)
|
|||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_QueryAccept(pin, &mp1_mt);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_QueryAccept(pin, &mp2_mt);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IPin_QueryAccept(pin, &mp3_mt0);
|
||||
todo_wine ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
ok(hr == S_FALSE, "Got hr %#lx.\n", hr);
|
||||
|
||||
mt = mp3_mt1;
|
||||
mt.majortype = GUID_NULL;
|
||||
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);
|
||||
|
||||
mt = mp3_mt1;
|
||||
mt.formattype = GUID_NULL;
|
||||
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);
|
||||
|
||||
|
|
|
@ -737,6 +737,18 @@ HRESULT mpeg_audio_codec_create(IUnknown *outer, IUnknown **out)
|
|||
|
||||
static HRESULT mpeg_layer3_decoder_sink_query_accept(struct transform *filter, const AM_MEDIA_TYPE *mt)
|
||||
{
|
||||
const MPEGLAYER3WAVEFORMAT *format;
|
||||
|
||||
if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Audio)
|
||||
|| !IsEqualGUID(&mt->formattype, &FORMAT_WaveFormatEx)
|
||||
|| mt->cbFormat < sizeof(MPEGLAYER3WAVEFORMAT))
|
||||
return S_FALSE;
|
||||
|
||||
format = (const MPEGLAYER3WAVEFORMAT *)mt->pbFormat;
|
||||
|
||||
if (format->wfx.wFormatTag != WAVE_FORMAT_MPEGLAYER3)
|
||||
return S_FALSE;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue