[vlc-commits] Qt: video filter helper for getting the filter type

Jean-Baptiste Kempf git at videolan.org
Fri Aug 15 20:39:27 CEST 2014


vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Aug 15 07:53:47 2014 +0200| [5a4627848b6e5aa9d7f5636a3056546ebdf5c30d] | committer: Jean-Baptiste Kempf

Qt: video filter helper for getting the filter type

Ref #11613

(cherry picked from commit 78ea3f23df02fa470d0d9de50ab9306348014d2f)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=5a4627848b6e5aa9d7f5636a3056546ebdf5c30d
---

 modules/gui/qt4/components/extended_panels.cpp |   31 ++++++++++--------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 84d16ae..1d2f4ac 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -354,39 +354,34 @@ static void ChangeAFiltersString( struct intf_thread_t *p_intf, const char *psz_
     free( psz_string );
 }
 
-static void ChangeVFiltersString( struct intf_thread_t *p_intf, const char *psz_name, bool b_add )
+static const char* GetVFilterType( struct intf_thread_t *p_intf, const char *psz_name )
 {
-    char *psz_string;
-    const char *psz_filter_type;
-
     module_t *p_obj = module_find( psz_name );
     if( !p_obj )
     {
         msg_Err( p_intf, "Unable to find filter module \"%s\".", psz_name );
-        return;
+        return NULL;
     }
 
     if( module_provides( p_obj, "video splitter" ) )
-    {
-        psz_filter_type = "video-splitter";
-    }
+        return "video-splitter";
     else if( module_provides( p_obj, "video filter2" ) )
-    {
-        psz_filter_type = "video-filter";
-    }
+        return "video-filter";
     else if( module_provides( p_obj, "sub source" ) )
-    {
-        psz_filter_type = "sub-source";
-    }
+        return "sub-source";
     else if( module_provides( p_obj, "sub filter" ) )
-    {
-        psz_filter_type = "sub-filter";
-    }
+        return "sub-filter";
     else
     {
         msg_Err( p_intf, "Unknown video filter type." );
-        return;
+        return NULL;
     }
+}
+
+static void ChangeVFiltersString( struct intf_thread_t *p_intf, const char *psz_name, bool b_add )
+{
+    char *psz_string;
+    const char *psz_filter_type = GetVFilterType( p_intf, psz_name );
 
     psz_string = ChangeFiltersString( p_intf, psz_filter_type, psz_name, b_add );
     if( !psz_string )



More information about the vlc-commits mailing list