Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/multimedia.c | 4 ++++ dlls/amstream/tests/amstream.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/amstream/multimedia.c b/dlls/amstream/multimedia.c index e058e639dd..f615e436b1 100644 --- a/dlls/amstream/multimedia.c +++ b/dlls/amstream/multimedia.c @@ -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;
diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 3fb77f277a..7ebd54f6da 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -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);