Commit f446bb21 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

amstream: Increment/decrement IMediaStreamFilter refcount twice in…

amstream: Increment/decrement IMediaStreamFilter refcount twice in multimedia_stream_create/release(). Signed-off-by: 's avatarGijs Vermeulen <gijsvrm@gmail.com> Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent b116cf84
......@@ -92,6 +92,7 @@ static ULONG WINAPI multimedia_stream_Release(IAMMultiMediaStream *iface)
if (This->ipin)
IPin_Release(This->ipin);
IMediaStreamFilter_Release(This->filter);
IMediaStreamFilter_Release(This->filter);
if (This->media_seeking)
IMediaSeeking_Release(This->media_seeking);
if (This->media_control)
......@@ -518,6 +519,9 @@ HRESULT multimedia_stream_create(IUnknown *outer, void **out)
return hr;
}
/* The stream takes an additional reference to the filter. */
IMediaStreamFilter_AddRef(object->filter);
TRACE("Created multimedia stream %p.\n", object);
*out = &object->IAMMultiMediaStream_iface;
......
......@@ -1140,7 +1140,7 @@ static void test_enum_pins(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
hr = IMediaStreamFilter_EnumPins(filter, NULL);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
......@@ -1148,7 +1148,7 @@ static void test_enum_pins(void)
hr = IMediaStreamFilter_EnumPins(filter, &enum1);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ok(ref == 3, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
......@@ -1186,7 +1186,7 @@ static void test_enum_pins(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ref = get_refcount(filter);
todo_wine ok(ref == 4, "Got unexpected refcount %d.\n", ref);
ok(ref == 4, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
......@@ -1196,7 +1196,7 @@ static void test_enum_pins(void)
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(pins[0] == pin, "Expected pin %p, got %p.\n", pin, pins[0]);
ref = get_refcount(filter);
todo_wine ok(ref == 4, "Got unexpected refcount %d.\n", ref);
ok(ref == 4, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(enum1);
ok(ref == 1, "Got unexpected refcount %d.\n", ref);
ref = get_refcount(pin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment