Signed-off-by: Anton Baskanov baskanov@gmail.com --- dlls/quartz/tests/mpegaudio.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-)
diff --git a/dlls/quartz/tests/mpegaudio.c b/dlls/quartz/tests/mpegaudio.c index 296f5f479a0..def5dc90238 100644 --- a/dlls/quartz/tests/mpegaudio.c +++ b/dlls/quartz/tests/mpegaudio.c @@ -160,9 +160,8 @@ static const AM_MEDIA_TYPE pcm16ex_mt = static IBaseFilter *create_mpeg_audio_codec(void) { IBaseFilter *filter = NULL; - HRESULT hr = CoCreateInstance(&CLSID_CMpegAudioCodec, NULL, CLSCTX_INPROC_SERVER, + CoCreateInstance(&CLSID_CMpegAudioCodec, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (void **)&filter); - ok(hr == S_OK, "Got hr %#lx.\n", hr); return filter; }
@@ -321,7 +320,6 @@ static void test_aggregation(void)
hr = CoCreateInstance(&CLSID_CMpegAudioCodec, &test_outer, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&unk); - ok(hr == S_OK, "Got hr %#lx.\n", hr); if (FAILED(hr)) { skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); @@ -436,8 +434,8 @@ static void test_unconnected_filter_state(void)
static void test_enum_pins(void) { - IBaseFilter *filter; IEnumPins *enum1, *enum2; + IBaseFilter *filter; ULONG count, ref; IPin *pins[3]; HRESULT hr; @@ -564,8 +562,8 @@ static void test_enum_pins(void)
static void test_find_pin(void) { - IBaseFilter *filter; IEnumPins *enum_pins; + IBaseFilter *filter; IPin *pin, *pin2; HRESULT hr; ULONG ref; @@ -688,13 +686,20 @@ static void test_pin_info(void)
static void test_enum_media_types(void) { - IBaseFilter *filter = create_mpeg_audio_codec(); IEnumMediaTypes *enum1, *enum2; AM_MEDIA_TYPE *mts[1]; + IBaseFilter *filter; ULONG ref, count; HRESULT hr; IPin *pin;
+ filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + IBaseFilter_FindPin(filter, L"In", &pin);
hr = IPin_EnumMediaTypes(pin, &enum1); @@ -763,13 +768,20 @@ static void test_enum_media_types(void)
static void test_media_types(void) { - IBaseFilter *filter = create_mpeg_audio_codec(); + IBaseFilter *filter; WAVEFORMATEX format; AM_MEDIA_TYPE mt; HRESULT hr; ULONG ref; IPin *pin;
+ filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + IBaseFilter_FindPin(filter, L"In", &pin);
hr = IPin_QueryAccept(pin, &mp1_mt); @@ -1082,7 +1094,6 @@ static void test_source_allocator(IFilterGraph2 *graph, IMediaControl *control,
static void test_connect_pin(void) { - IBaseFilter *filter = create_mpeg_audio_codec(); struct testfilter testsource, testsink; AM_MEDIA_TYPE mt, source_mt, *pmt; WAVEFORMATEX source_format; @@ -1093,10 +1104,18 @@ static void test_connect_pin(void) IMemInputPin *meminput; AM_MEDIA_TYPE req_mt; IFilterGraph2 *graph; + IBaseFilter *filter; unsigned int i; HRESULT hr; ULONG ref;
+ filter = create_mpeg_audio_codec(); + if (!filter) + { + skip("Failed to create MPEG audio decoder instance, skipping tests.\n"); + return; + } + CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&graph); testfilter_init(&testsource);