amstream: Increase parent IAMMediaStream refcount in IDirectDrawMediaStream::CreateSample().
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com> Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a4ddb5a1e6
commit
a518975663
|
@ -1048,6 +1048,8 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface)
|
||||||
--sample->parent->sample_refs;
|
--sample->parent->sample_refs;
|
||||||
LeaveCriticalSection(&sample->parent->cs);
|
LeaveCriticalSection(&sample->parent->cs);
|
||||||
|
|
||||||
|
IAMMediaStream_Release(&sample->parent->IAMMediaStream_iface);
|
||||||
|
|
||||||
if (sample->surface)
|
if (sample->surface)
|
||||||
IDirectDrawSurface_Release(sample->surface);
|
IDirectDrawSurface_Release(sample->surface);
|
||||||
HeapFree(GetProcessHeap(), 0, sample);
|
HeapFree(GetProcessHeap(), 0, sample);
|
||||||
|
@ -1163,6 +1165,7 @@ static HRESULT ddrawstreamsample_create(struct ddraw_stream *parent, IDirectDraw
|
||||||
object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl;
|
object->IDirectDrawStreamSample_iface.lpVtbl = &DirectDrawStreamSample_Vtbl;
|
||||||
object->ref = 1;
|
object->ref = 1;
|
||||||
object->parent = parent;
|
object->parent = parent;
|
||||||
|
IAMMediaStream_AddRef(&parent->IAMMediaStream_iface);
|
||||||
++parent->sample_refs;
|
++parent->sample_refs;
|
||||||
|
|
||||||
if (surface)
|
if (surface)
|
||||||
|
|
|
@ -5670,7 +5670,7 @@ static void test_ddrawstream_create_sample(void)
|
||||||
EXPECT_REF(stream, 3);
|
EXPECT_REF(stream, 3);
|
||||||
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &sample);
|
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &sample);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
todo_wine EXPECT_REF(stream, 4);
|
EXPECT_REF(stream, 4);
|
||||||
|
|
||||||
hr = IDirectDrawStreamSample_GetSurface(sample, NULL, NULL);
|
hr = IDirectDrawStreamSample_GetSurface(sample, NULL, NULL);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
|
@ -5773,13 +5773,13 @@ static void test_ddrawstreamsample_get_media_stream(void)
|
||||||
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
|
||||||
}
|
}
|
||||||
|
|
||||||
todo_wine EXPECT_REF(stream, 4);
|
EXPECT_REF(stream, 4);
|
||||||
hr = IDirectDrawStreamSample_GetMediaStream(sample, &stream2);
|
hr = IDirectDrawStreamSample_GetMediaStream(sample, &stream2);
|
||||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||||
ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2);
|
ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2);
|
||||||
todo_wine EXPECT_REF(stream, 5);
|
EXPECT_REF(stream, 5);
|
||||||
IMediaStream_Release(stream2);
|
IMediaStream_Release(stream2);
|
||||||
todo_wine EXPECT_REF(stream, 4);
|
EXPECT_REF(stream, 4);
|
||||||
|
|
||||||
IDirectDrawMediaStream_Release(ddraw_stream);
|
IDirectDrawMediaStream_Release(ddraw_stream);
|
||||||
ref = IDirectDrawStreamSample_Release(sample);
|
ref = IDirectDrawStreamSample_Release(sample);
|
||||||
|
|
Loading…
Reference in New Issue