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

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

 



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@xxxxxxxxxxxxxxx>
---
 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
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]