[PATCH spice-server 28/28] red_worker: assign mm_time to vga frames

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

 



---
 server/red_worker.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 81b86de..f341b15 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -8565,6 +8565,7 @@ static inline int red_marshall_stream_data(RedChannelClient *rcc,
     Stream *stream = drawable->stream;
     SpiceImage *image;
     RedWorker *worker = dcc->common.worker;
+    uint32_t frame_mm_time;
     int n;
     int width, height;
     int ret;
@@ -8610,12 +8611,16 @@ static inline int red_marshall_stream_data(RedChannelClient *rcc,
         }
     }
 
+    /* workaround for vga streams */
+    frame_mm_time =  drawable->red_drawable->mm_time ?
+                        drawable->red_drawable->mm_time :
+                        reds_get_mm_time();
     outbuf_size = dcc->send_data.stream_outbuf_size;
     ret = mjpeg_encoder_start_frame(agent->mjpeg_encoder, image->u.bitmap.format,
                                     width, height,
                                     &dcc->send_data.stream_outbuf,
                                     &outbuf_size,
-                                    drawable->red_drawable->mm_time);
+                                    frame_mm_time);
     switch (ret) {
     case MJPEG_ENCODER_FRAME_DROP:
         spice_assert(dcc->use_mjpeg_encoder_rate_control);
@@ -8644,7 +8649,7 @@ static inline int red_marshall_stream_data(RedChannelClient *rcc,
         red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_DATA, NULL);
 
         stream_data.base.id = get_stream_id(worker, stream);
-        stream_data.base.multi_media_time = drawable->red_drawable->mm_time;
+        stream_data.base.multi_media_time = frame_mm_time;
         stream_data.data_size = n;
 
         spice_marshall_msg_display_stream_data(base_marshaller, &stream_data);
@@ -8654,7 +8659,7 @@ static inline int red_marshall_stream_data(RedChannelClient *rcc,
         red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_DATA_SIZED, NULL);
 
         stream_data.base.id = get_stream_id(worker, stream);
-        stream_data.base.multi_media_time = drawable->red_drawable->mm_time;
+        stream_data.base.multi_media_time = frame_mm_time;
         stream_data.data_size = n;
         stream_data.width = width;
         stream_data.height = height;
@@ -8670,7 +8675,7 @@ static inline int red_marshall_stream_data(RedChannelClient *rcc,
 #ifdef STREAM_STATS
     agent->stats.num_frames_sent++;
     agent->stats.size_sent += n;
-    agent->stats.end = drawable->red_drawable->mm_time;
+    agent->stats.end = frame_mm_time;
 #endif
 
     return TRUE;
-- 
1.8.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


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