[cheese/cheese-window-refactor] Remove redundant caps_can_intersect call



commit 6670758f27f48a008937268ee3f7cabb2f36dc18
Author: Filippo Argiolas <filippo argiolas gmail com>
Date:   Tue Feb 2 11:20:07 2010 +0100

    Remove redundant caps_can_intersect call
    
    No need to treat differently the empty intersection case.
    Speed up caps setting getting rid of one extra intersection computation.

 libcheese/cheese-camera-device.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index 6e21b16..bd0d235 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -625,14 +625,8 @@ cheese_camera_device_get_caps_for_format (CheeseCameraDevice *device,
                                           NULL));
   }
 
-  if (!gst_caps_can_intersect (desired_caps, priv->caps))
-  {
-    subset_caps = gst_caps_new_empty ();
-    gst_caps_unref (desired_caps);
-  } else {
-    subset_caps = gst_caps_intersect (desired_caps, priv->caps);
-    gst_caps_unref (desired_caps);
-  }
+  subset_caps = gst_caps_intersect (desired_caps, priv->caps);
+  gst_caps_unref (desired_caps);
 
   GST_INFO ("Got %" GST_PTR_FORMAT, subset_caps);
 



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