Commit bcfa8f41 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz: Move the current sample tracking back to strmbase.

Only the video renderer uses this, but we'd like to deduplicate the wait-on-preroll behaviour. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d52c4eb0
...@@ -50,7 +50,6 @@ struct video_renderer ...@@ -50,7 +50,6 @@ struct video_renderer
DWORD saved_style; DWORD saved_style;
HANDLE run_event; HANDLE run_event;
IMediaSample *current_sample;
}; };
static inline struct video_renderer *impl_from_video_window(struct video_window *iface) 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 ...@@ -109,14 +108,10 @@ 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;
SetEvent(filter->renderer.state_event); SetEvent(filter->renderer.state_event);
LeaveCriticalSection(&filter->renderer.filter.stream_cs); LeaveCriticalSection(&filter->renderer.filter.stream_cs);
WaitForMultipleObjects(2, events, FALSE, INFINITE); WaitForMultipleObjects(2, events, FALSE, INFINITE);
EnterCriticalSection(&filter->renderer.filter.stream_cs); EnterCriticalSection(&filter->renderer.filter.stream_cs);
filter->current_sample = NULL;
} }
return S_OK; return S_OK;
...@@ -276,7 +271,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG ...@@ -276,7 +271,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG
return VFW_E_NOT_PAUSED; return VFW_E_NOT_PAUSED;
} }
if (!filter->current_sample) if (!filter->renderer.current_sample)
{ {
LeaveCriticalSection(&filter->renderer.filter.stream_cs); LeaveCriticalSection(&filter->renderer.filter.stream_cs);
return E_UNEXPECTED; return E_UNEXPECTED;
...@@ -289,7 +284,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG ...@@ -289,7 +284,7 @@ static HRESULT video_renderer_get_current_image(struct video_window *iface, LONG
} }
memcpy(image, bih, sizeof(BITMAPINFOHEADER)); 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); memcpy((char *)image + sizeof(BITMAPINFOHEADER), sample_data, image_size);
LeaveCriticalSection(&filter->renderer.filter.stream_cs); LeaveCriticalSection(&filter->renderer.filter.stream_cs);
......
...@@ -353,7 +353,11 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp ...@@ -353,7 +353,11 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
} }
if (state == State_Paused) if (state == State_Paused)
{
filter->current_sample = sample;
hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample); hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample);
filter->current_sample = NULL;
}
if (need_wait) if (need_wait)
{ {
......
...@@ -291,6 +291,8 @@ struct strmbase_renderer ...@@ -291,6 +291,8 @@ struct strmbase_renderer
HANDLE flush_event; HANDLE flush_event;
REFERENCE_TIME stream_start; REFERENCE_TIME stream_start;
IMediaSample *current_sample;
IQualityControl *qc_sink; IQualityControl *qc_sink;
REFERENCE_TIME last_left, avg_duration, avg_pt; REFERENCE_TIME last_left, avg_duration, avg_pt;
double avg_rate; double avg_rate;
......
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