[Spice-devel] server: Define the MJPEG encoder warmup time in nanoseconds

Francois Gouget fgouget at codeweavers.com
Sat Dec 5 04:06:08 PST 2015


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 server/mjpeg-encoder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

There is no point making it look like milliseconds when it's in fact 
used with nanosecond variables.

diff --git a/server/mjpeg-encoder.c b/server/mjpeg-encoder.c
index 3f54112..08af1eb 100644
--- a/server/mjpeg-encoder.c
+++ b/server/mjpeg-encoder.c
@@ -68,7 +68,7 @@ static const int mjpeg_quality_samples[MJPEG_QUALITY_SAMPLE_NUM] = {20, 30, 40,
  * are not necessarily related to mis-estimation of the bit rate, and we would
  * like to wait till the stream stabilizes.
  */
-#define MJPEG_WARMUP_TIME 3000LL // 3 sec
+#define MJPEG_WARMUP_TIME 3000000000LL // 3 sec
 
 enum {
     MJPEG_QUALITY_EVAL_TYPE_SET,
@@ -996,7 +996,7 @@ static void mjpeg_encoder_decrease_bit_rate(MJpegEncoder *encoder)
         uint64_t now;
 
         now = red_get_monotonic_time();
-        if (now - rate_control->warmup_start_time < MJPEG_WARMUP_TIME*1000*1000) {
+        if (now - rate_control->warmup_start_time < MJPEG_WARMUP_TIME) {
             spice_debug("during warmup. ignoring");
             return;
         } else {
-- 
2.6.2



More information about the Spice-devel mailing list