strmbase: Record jitter before waiting for presentation time.

Otherwise we will consistently report that samples are late. In practice this
can end up causing GStreamer to drop many video samples, which is one of the
apparent causes of bug 50733.

At the same time, don't record jitter *before* signalling preroll, as in that
case stream_start will not yet be valid, and we'll end up recording something
near the current tick count, and in this way also incorrectly report that
samples are late.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-03-09 16:19:56 -06:00 committed by Alexandre Julliard
parent 1564d65868
commit d99912aa65
1 changed files with 10 additions and 11 deletions

View File

@ -378,14 +378,9 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
strmbase_passthrough_update_time(&filter->passthrough, start);
need_wait = TRUE;
}
else
start = stop = -1;
if (state == State_Paused)
{
begin_render(filter, start, stop);
hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample);
}
if (need_wait)
{
@ -394,6 +389,8 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
IReferenceClock_GetTime(filter->filter.clock, &now);
begin_render(filter, start, stop);
if (now - filter->stream_start - start <= -10000)
{
HANDLE handles[2] = {filter->advise_event, filter->flush_event};
@ -411,16 +408,18 @@ static HRESULT WINAPI BaseRenderer_Receive(struct strmbase_sink *pin, IMediaSamp
return S_OK;
}
}
}
if (state == State_Running)
if (state == State_Running)
hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample);
perform_qos(filter);
}
else
{
begin_render(filter, start, stop);
hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample);
if (state == State_Running)
hr = filter->pFuncsTable->pfnDoRenderSample(filter, sample);
}
perform_qos(filter);
return hr;
}