[cheese] Skip loading effects with missing plugins



commit 76d16a7b05ec64fb8c6aa806d195e3afb0c659e3
Author: David King <amigadave amigadave com>
Date:   Sun Sep 8 12:20:55 2013 +0100

    Skip loading effects with missing plugins
    
    If effects modules are missing, do not load them into EffectsManager to
    skip showing them in the UI. Fixes bug 702995.

 src/cheese-effects-manager.vala |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/cheese-effects-manager.vala b/src/cheese-effects-manager.vala
index 4ef6c3b..f31eca4 100644
--- a/src/cheese-effects-manager.vala
+++ b/src/cheese-effects-manager.vala
@@ -19,8 +19,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-using GLib;
-
 internal class Cheese.EffectsManager : GLib.Object
 {
     public List<Effect> effects;
@@ -60,7 +58,18 @@ internal class Cheese.EffectsManager : GLib.Object
      */
     private void add_effect (string name, Effect effect)
     {
-        effects.insert_sorted (effect, sort_value);
+        try
+        {
+            // Test effect to see if it can be created. Bug 702995.
+            Gst.parse_bin_from_description (effect.pipeline_desc, false, null,
+                                            Gst.ParseFlags.FATAL_ERRORS);
+            effects.insert_sorted (effect, sort_value);
+        }
+        catch (Error err)
+        {
+            debug ("Effect '%s' did not parse correctly, skipping: %s",
+                   effect.name, err.message);
+        }
     }
 
     /**


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