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: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d52c4eb00c
commit
bcfa8f413b
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue