diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index a925340a676..ed5774bf484 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -50,7 +50,6 @@ struct video_renderer DWORD saved_style; HANDLE run_event; - IMediaSample *current_sample; }; static inline struct video_renderer *impl_from_video_window(struct video_window *iface) @@ -109,14 +108,10 @@ static HRESULT WINAPI VideoRenderer_DoRenderSample(struct strmbase_renderer *ifa { const HANDLE events[2] = {filter->run_event, filter->renderer.flush_event}; - filter->current_sample = pSample; - SetEvent(filter->renderer.state_event); LeaveCriticalSection(&filter->renderer.filter.stream_cs); WaitForMultipleObjects(2, events, FALSE, INFINITE); EnterCriticalSection(&filter->renderer.filter.stream_cs); - - filter->current_sample = NULL; } return S_OK; @@ -276,7 +271,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG return VFW_E_NOT_PAUSED; } - if (!filter->current_sample) + if (!filter->renderer.current_sample) { LeaveCriticalSection(&filter->renderer.filter.stream_cs); return E_UNEXPECTED; @@ -289,7 +284,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG } memcpy(image, bih, sizeof(BITMAPINFOHEADER)); - IMediaSample_GetPointer(filter->current_sample, &sample_data); + IMediaSample_GetPointer(filter->renderer.current_sample, &sample_data); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size); LeaveCriticalSection(&filter->renderer.filter.stream_cs); diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c index 47017f5ced5..b384ea991d9 100644 --- a/dlls/strmbase/renderer.c +++ b/dlls/strmbase/renderer.c @@ -353,7 +353,11 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp } if (state == State_Paused) + { + filter->current_sample = sample; hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample); + filter->current_sample = NULL; + } if (need_wait) { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 4b5ecc86721..e902790ecb1 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -291,6 +291,8 @@ struct strmbase_renderer HANDLE flush_event; REFERENCE_TIME stream_start; + IMediaSample *current_sample; + IQualityControl *qc_sink; REFERENCE_TIME last_left, avg_duration, avg_pt; double avg_rate;