Zebediah Figura : strmbase: Record jitter before waiting for presentation time.

Alexandre Julliard julliard at winehq.org
Wed Mar 10 14:58:45 CST 2021


Module: wine
Branch: master
Commit: d99912aa65d63973af64f130659ecc36cce82e0d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d99912aa65d63973af64f130659ecc36cce82e0d

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Tue Mar  9 16:19:56 2021 -0600

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 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/strmbase/renderer.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/dlls/strmbase/renderer.c b/dlls/strmbase/renderer.c
index 6a3164eee6a..b3641ddee6d 100644
--- a/dlls/strmbase/renderer.c
+++ b/dlls/strmbase/renderer.c
@@ -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;
 }
 




More information about the wine-cvs mailing list