[Spice-commits] 2 commits - server/stream.c server/stream.h

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Aug 2 09:25:01 UTC 2016


 server/stream.c |   29 ++++++++++++++---------------
 server/stream.h |    4 ++--
 2 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit f27ee4c0db98599c6aacef833de061c314e0c234
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Aug 2 10:09:37 2016 +0100

    Reduce indentation inverting condition
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/stream.c b/server/stream.c
index d1f92c3..96aca55 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -250,20 +250,19 @@ static bool is_next_stream_frame(DisplayChannel *display,
             return FALSE;
         }
     } else {
-        if (rect_contains(&red_drawable->bbox, other_dest)) {
-            int candidate_area = rect_get_area(&red_drawable->bbox);
-            int other_area = rect_get_area(other_dest);
-            /* do not stream drawables that are significantly
-             * bigger than the original frame */
-            if (candidate_area > 2 * other_area) {
-                spice_debug("too big candidate:");
-                spice_debug("prev box ==>");
-                rect_debug(other_dest);
-                spice_debug("new box ==>");
-                rect_debug(&red_drawable->bbox);
-                return FALSE;
-            }
-        } else {
+        if (!rect_contains(&red_drawable->bbox, other_dest)) {
+            return FALSE;
+        }
+        int candidate_area = rect_get_area(&red_drawable->bbox);
+        int other_area = rect_get_area(other_dest);
+        /* do not stream drawables that are significantly
+         * bigger than the original frame */
+        if (candidate_area > 2 * other_area) {
+            spice_debug("too big candidate:");
+            spice_debug("prev box ==>");
+            rect_debug(other_dest);
+            spice_debug("new box ==>");
+            rect_debug(&red_drawable->bbox);
             return FALSE;
         }
     }
commit 777a4c4987cd657c7d0f463e615905e6263b2a2b
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Aug 2 10:08:29 2016 +0100

    Fix typo for macro names
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/server/stream.c b/server/stream.c
index 985bc71..d1f92c3 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -232,7 +232,7 @@ static bool is_next_stream_frame(DisplayChannel *display,
     }
 
     if (candidate->creation_time - other_time >
-            (stream ? RED_STREAM_CONTINUS_MAX_DELTA : RED_STREAM_DETACTION_MAX_DELTA)) {
+            (stream ? RED_STREAM_CONTINUOUS_MAX_DELTA : RED_STREAM_DETECTION_MAX_DELTA)) {
         return FALSE;
     }
 
diff --git a/server/stream.h b/server/stream.h
index b4fe540..c40c188 100644
--- a/server/stream.h
+++ b/server/stream.h
@@ -26,8 +26,8 @@
 #include "red-channel.h"
 #include "image-cache.h"
 
-#define RED_STREAM_DETACTION_MAX_DELTA (NSEC_PER_SEC / 5)
-#define RED_STREAM_CONTINUS_MAX_DELTA NSEC_PER_SEC
+#define RED_STREAM_DETECTION_MAX_DELTA (NSEC_PER_SEC / 5)
+#define RED_STREAM_CONTINUOUS_MAX_DELTA NSEC_PER_SEC
 #define RED_STREAM_TIMEOUT NSEC_PER_SEC
 #define RED_STREAM_FRAMES_START_CONDITION 20
 #define RED_STREAM_GRADUAL_FRAMES_START_CONDITION 0.2


More information about the Spice-commits mailing list