[vlmc-devel] EffectUser.cpp: Check type of the effect and only add supported effect types

Rohit Yadav git at videolan.org
Wed Jul 27 19:29:48 CEST 2011


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Wed Jul 27 20:57:26 2011 +0530| [f96043e8479527872c608e2e4ab0c6502a5849e6] | committer: Rohit Yadav

EffectUser.cpp: Check type of the effect and only add supported effect types
Supported effect types currently are Effect::Filter and Effect::Mixer2

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=f96043e8479527872c608e2e4ab0c6502a5849e6
---

 src/EffectsEngine/EffectUser.cpp |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/EffectsEngine/EffectUser.cpp b/src/EffectsEngine/EffectUser.cpp
index 4d5e623..4d42ca4 100644
--- a/src/EffectsEngine/EffectUser.cpp
+++ b/src/EffectsEngine/EffectUser.cpp
@@ -47,11 +47,15 @@ EffectUser::~EffectUser()
 EffectHelper*
 EffectUser::addEffect( Effect *effect, qint64 start /*= 0*/, qint64 end /*= -1*/ )
 {
-    //FIXME: Check it the effect type is supported
-    EffectInstance  *effectInstance = effect->createInstance();
-    EffectHelper *ret = new EffectHelper( effectInstance, start, end );
-    addEffect( ret );
-    return ret;
+    //Check that effect type is one of the supported ones
+    if ( effect->type() == Effect::Filter  || effect->type() == Effect::Mixer2 )
+    {
+        EffectInstance  *effectInstance = effect->createInstance();
+        EffectHelper *ret = new EffectHelper( effectInstance, start, end );
+        addEffect( ret );
+        return ret;
+    }
+    return NULL;
 }
 
 void



More information about the Vlmc-devel mailing list