Commit 5f9ce687 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/videorenderer: Track the current sample locally.

Only the video renderer uses it. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a4e8e4df
...@@ -56,6 +56,7 @@ typedef struct VideoRendererImpl ...@@ -56,6 +56,7 @@ typedef struct VideoRendererImpl
DWORD saved_style; DWORD saved_style;
HANDLE run_event; HANDLE run_event;
IMediaSample *current_sample;
} VideoRendererImpl; } VideoRendererImpl;
static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface) static inline VideoRendererImpl *impl_from_BaseWindow(BaseWindow *iface)
...@@ -177,9 +178,13 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa ...@@ -177,9 +178,13 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa
{ {
const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event}; const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event};
filter->current_sample = pSample;
LeaveCriticalSection(&filter->renderer.csRenderLock); LeaveCriticalSection(&filter->renderer.csRenderLock);
WaitForMultipleObjects(2, events, FALSE, INFINITE); WaitForMultipleObjects(2, events, FALSE, INFINITE);
EnterCriticalSection(&filter->renderer.csRenderLock); EnterCriticalSection(&filter->renderer.csRenderLock);
filter->current_sample = NULL;
} }
return S_OK; return S_OK;
...@@ -381,7 +386,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG ...@@ -381,7 +386,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG
return VFW_E_NOT_PAUSED; return VFW_E_NOT_PAUSED;
} }
if (!filter->renderer.pMediaSample) if (!filter->current_sample)
{ {
LeaveCriticalSection(&filter->renderer.csRenderLock); LeaveCriticalSection(&filter->renderer.csRenderLock);
return E_UNEXPECTED; return E_UNEXPECTED;
...@@ -394,7 +399,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG ...@@ -394,7 +399,7 @@ static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG
} }
memcpy(image, bih, sizeof(BITMAPINFOHEADER)); memcpy(image, bih, sizeof(BITMAPINFOHEADER));
IMediaSample_GetPointer(filter->renderer.pMediaSample, &sample_data); IMediaSample_GetPointer(filter->current_sample, &sample_data);
memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size);
LeaveCriticalSection(&filter->renderer.csRenderLock); LeaveCriticalSection(&filter->renderer.csRenderLock);
......
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