amstream: Lock the entirety of 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
c80d5c1507
commit
276701e9b4
|
@ -437,11 +437,16 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_CreateSample(IDirectDrawMedia
|
||||||
IDirectDrawStreamSample **sample)
|
IDirectDrawStreamSample **sample)
|
||||||
{
|
{
|
||||||
struct ddraw_stream *stream = impl_from_IDirectDrawMediaStream(iface);
|
struct ddraw_stream *stream = impl_from_IDirectDrawMediaStream(iface);
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n",
|
TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n",
|
||||||
stream, surface, wine_dbgstr_rect(rect), flags, sample);
|
stream, surface, wine_dbgstr_rect(rect), flags, sample);
|
||||||
|
|
||||||
return ddrawstreamsample_create(stream, surface, rect, sample);
|
EnterCriticalSection(&stream->cs);
|
||||||
|
hr = ddrawstreamsample_create(stream, surface, rect, sample);
|
||||||
|
LeaveCriticalSection(&stream->cs);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ddraw_IDirectDrawMediaStream_GetTimePerFrame(IDirectDrawMediaStream *iface,
|
static HRESULT WINAPI ddraw_IDirectDrawMediaStream_GetTimePerFrame(IDirectDrawMediaStream *iface,
|
||||||
|
@ -1163,10 +1168,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;
|
||||||
|
|
||||||
EnterCriticalSection(&parent->cs);
|
|
||||||
++parent->sample_refs;
|
++parent->sample_refs;
|
||||||
LeaveCriticalSection(&parent->cs);
|
|
||||||
|
|
||||||
if (surface)
|
if (surface)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue