Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/tests/mpegaudio.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 1983828beb0..aa249c82e84 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -185,8 +185,10 @@ static void init_pcm_mt(AM_MEDIA_TYPE *mt, WAVEFORMATEX *format, mt->majortype = MEDIATYPE_Audio; mt->subtype = MEDIASUBTYPE_PCM; mt->bFixedSizeSamples = TRUE; + mt->bTemporalCompression = FALSE; mt->lSampleSize = format->nBlockAlign; mt->formattype = FORMAT_WaveFormatEx; + mt->pUnk = NULL; mt->cbFormat = sizeof(WAVEFORMATEX); mt->pbFormat = (BYTE *)format; } @@ -935,12 +937,14 @@ static void test_connect_pin(void) IBaseFilter *filter = create_mpeg_audio_codec(); struct testfilter testsource; IPin *sink, *source, *peer; + IEnumMediaTypes *enummt; WAVEFORMATEX req_format; IMediaControl *control; + AM_MEDIA_TYPE mt, *pmt; IMemInputPin *meminput; AM_MEDIA_TYPE req_mt; IFilterGraph2 *graph; - AM_MEDIA_TYPE mt; + unsigned int i; HRESULT hr; ULONG ref;
@@ -1045,6 +1049,33 @@ static void test_connect_pin(void) hr = IMediaControl_Stop(control); ok(hr == S_OK, "Got hr %#lx.\n", hr);
+ hr = IPin_EnumMediaTypes(source, &enummt); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + for (i = 0; i < 2; ++i) + { + WAVEFORMATEX expect_format; + AM_MEDIA_TYPE expect_mt; + + init_pcm_mt(&expect_mt, &expect_format, 1, 32000, i ? 8 : 16); + + hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL); + todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (hr != S_OK) + break; + ok(!memcmp(pmt, &expect_mt, offsetof(AM_MEDIA_TYPE, cbFormat)), + "%u: Media types didn't match.\n", i); + ok(!memcmp(pmt->pbFormat, &expect_format, sizeof(WAVEFORMATEX)), + "%u: Format blocks didn't match.\n", i); + + DeleteMediaType(pmt); + } + + hr = IEnumMediaTypes_Next(enummt, 1, &pmt, NULL); + ok(hr == S_FALSE, "Got hr %#lx.\n", hr); + + IEnumMediaTypes_Release(enummt); + test_sink_allocator(meminput);
IMemInputPin_Release(meminput);