[Spice-devel] [client] gstreamer: A frame is not late if it should be displayed immediately

Francois Gouget fgouget at codeweavers.com
Tue Jun 11 09:30:30 UTC 2019


schedule_frame() was expecting to be called at least 1 ms before having
to display the frame which is wrong: being called 0 ms before is
acceptable too. Thankfully the frame would usually be the last decoded
frame and would thus be displayed anyway.
Also reverse the inequality to make it easier to understand.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 src/channel-display-gst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
index 858e8aeb..91ece0fa 100644
--- a/src/channel-display-gst.c
+++ b/src/channel-display-gst.c
@@ -200,7 +200,7 @@ static void schedule_frame(SpiceGstDecoder *decoder)
             break;
         }
 
-        if (spice_mmtime_diff(now, gstframe->encoded_frame->mm_time) < 0) {
+        if (spice_mmtime_diff(gstframe->encoded_frame->mm_time, now) >= 0) {
             decoder->timer_id = g_timeout_add(gstframe->encoded_frame->mm_time - now,
                                               display_frame, decoder);
         } else if (decoder->display_frame && !decoder->pending_samples) {
-- 
2.20.1


More information about the Spice-devel mailing list