[gnome-network-displays] wfd-media-factory: Fix GStreamer-CRITICAL on stream start



commit 33a80123a1c3aa0de02b952262231d320f47216f
Author: Christian Glombek <lorbus fedoraproject org>
Date:   Fri Jan 21 19:42:35 2022 +0100

    wfd-media-factory: Fix GStreamer-CRITICAL on stream start
    
    Fixes:
    ```
    (gnome-network-displays:70304): GStreamer-CRITICAL **: 19:18:24.165: gst_event_new_qos: assertion 'diff 
= 0 || -diff <= timestamp' failed
    
    (gnome-network-displays:70304): GStreamer-CRITICAL **: 19:18:24.165: gst_element_send_event: assertion 
'event != NULL' failed
    ```

 src/wfd/wfd-media-factory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/wfd/wfd-media-factory.c b/src/wfd/wfd-media-factory.c
index 328b33b..956ad56 100644
--- a/src/wfd/wfd-media-factory.c
+++ b/src/wfd/wfd-media-factory.c
@@ -81,7 +81,7 @@ encoding_perf_handoff_cb (GstElement *elem, GstBuffer *buf, gpointer user_data)
       late = MAX (0, now - pts);
 
       /* Ignore the first few frames. */
-      if (pts > 100 * GST_MSECOND)
+      if (pts > 100 * GST_MSECOND && (late - 50 * GST_MSECOND >= 0 || -(late - 50 * GST_MSECOND) <= pts))
         {
           /* We stop accepting things at more than 50ms delay;
            * Just use late / 50ms for the long term proportion. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]