[Spice-devel] [client v2 12/12] mjpeg: Take the decoding time into account to display frames

Francois Gouget fgouget at codeweavers.com
Mon Jun 17 17:36:48 UTC 2019


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 src/channel-display-mjpeg.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c
index 20e10d9b..764f0611 100644
--- a/src/channel-display-mjpeg.c
+++ b/src/channel-display-mjpeg.c
@@ -189,6 +189,9 @@ static void mjpeg_decoder_schedule(MJpegDecoder *decoder)
         if (frame) {
             if (spice_mmtime_diff(time, frame->time) <= 0) {
                 guint32 d = frame->time - time;
+                if (d > decoder->base.decoding_time) {
+                    d -= decoder->base.decoding_time;
+                }
                 decoder->cur_frame = frame;
                 decoder->timer_id = g_timeout_add(d, mjpeg_decoder_decode_frame, decoder);
                 break;
-- 
2.20.1


More information about the Spice-devel mailing list