[client,v3,6/6] mjpeg: Take the decoding time into account to display frames

Submitted by Francois Gouget on June 25, 2019, 11:45 p.m.

Details

Message ID 19e459ca40e222bc71fa7e1ade77d1385513db7c.1561506197.git.fgouget@free.fr
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget June 25, 2019, 11:45 p.m.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
---
 src/channel-display-mjpeg.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

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;