[Spice-commits] server/mjpeg_encoder.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Dec 3 07:36:48 PST 2015


 server/mjpeg_encoder.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 43d6c5b9ee580d1f119e9d6cc04f97386632f6a0
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Thu Dec 3 15:34:57 2015 +0000

    server: Reuse red_get_monotonic_time() in the MJPEG video encoder
    
    Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index 9b331c1..5a33cb5 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -1353,16 +1353,13 @@ MJpegEncoder *mjpeg_encoder_new(uint64_t starting_bit_rate,
     encoder->starting_bit_rate = starting_bit_rate;
 
     if (cbs) {
-        struct timespec time;
-
-        clock_gettime(CLOCK_MONOTONIC, &time);
         encoder->cbs = *cbs;
         encoder->cbs_opaque = cbs_opaque;
         mjpeg_encoder_reset_quality(encoder, MJPEG_QUALITY_SAMPLE_NUM / 2, 5, 0);
         encoder->rate_control.during_quality_eval = TRUE;
         encoder->rate_control.quality_eval_data.type = MJPEG_QUALITY_EVAL_TYPE_SET;
         encoder->rate_control.quality_eval_data.reason = MJPEG_QUALITY_EVAL_REASON_RATE_CHANGE;
-        encoder->rate_control.warmup_start_time = ((uint64_t) time.tv_sec) * 1000000000 + time.tv_nsec;
+        encoder->rate_control.warmup_start_time = red_get_monotonic_time();
     } else {
         encoder->cbs.get_roundtrip_ms = NULL;
         mjpeg_encoder_reset_quality(encoder, MJPEG_LEGACY_STATIC_QUALITY_ID, MJPEG_MAX_FPS, 0);


More information about the Spice-commits mailing list