From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/amstream/ddrawstream.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index a8974a786e7..cbd88187e1b 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -1456,6 +1456,7 @@ static HRESULT WINAPI ddraw_mem_allocator_Decommit(IMemAllocator *iface)
EnterCriticalSection(&stream->cs); stream->committed = false; + WakeAllConditionVariable(&stream->allocator_cv); /* We have nothing to actually decommit; all of our samples are created by * CreateSample(). */ LeaveCriticalSection(&stream->cs); @@ -1487,15 +1488,15 @@ static HRESULT WINAPI ddraw_mem_allocator_GetBuffer(IMemAllocator *iface,
EnterCriticalSection(&stream->cs);
+ while (stream->committed && !(sample = get_pending_sample(stream))) + SleepConditionVariableCS(&stream->allocator_cv, &stream->cs, INFINITE); + if (!stream->committed) { LeaveCriticalSection(&stream->cs); return VFW_E_NOT_COMMITTED; }
- while (!(sample = get_pending_sample(stream))) - SleepConditionVariableCS(&stream->allocator_cv, &stream->cs, INFINITE); - sample->surface_desc.dwSize = sizeof(DDSURFACEDESC); if ((FAILED(hr = IDirectDrawSurface_Lock(sample->surface, &sample->rect, &sample->surface_desc, DDLOCK_WAIT, NULL))))