]> git.sesse.net Git - vlc/commitdiff
Fix use of logo and erase filters in the Qt extended intf.
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 9 Sep 2008 17:50:16 +0000 (19:50 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 9 Sep 2008 17:50:43 +0000 (19:50 +0200)
modules/gui/qt4/components/extended_panels.cpp
modules/video_filter/logo.c

index 04d07f1a49c59a96d3c03257de7001144ca1a535..ab69cedace9385c97a76fa2e44a494a193bc8314 100644 (file)
@@ -250,8 +250,6 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
     char *psz_parser, *psz_string;
     const char *psz_filter_type;
 
-    /* Please leave p_libvlc_global. This is where cached modules are
-     * stored. We're not trying to find a module instance. */
     module_t *p_obj = module_Find( p_intf, psz_name );
     if( !p_obj )
     {
@@ -504,14 +502,20 @@ void ExtVideo::updateFilterOptions()
         vlc_object_find_name( p_intf->p_libvlc,
                               qtu( module ),
                               FIND_CHILD );
+    int i_type;
+    bool b_is_command;
     if( !p_obj )
     {
-        msg_Err( p_intf, "Module %s not found.", qtu( module ) );
-        return;
+        msg_Warn( p_intf, "Module %s not found. You'll need to restart the filter to take the change into account.", qtu( module ) );
+        i_type = config_GetType( p_intf, qtu( option ) );
+        b_is_command = false;
+    }
+    else
+    {
+        i_type = var_Type( p_obj, qtu( option ) );
+        b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
     }
 
-    int i_type = var_Type( p_obj, qtu( option ) );
-    bool b_is_command = ( i_type & VLC_VAR_ISCOMMAND );
     if( !b_is_command )
     {
         msg_Warn( p_intf, "Module %s's %s variable isn't a command. You'll need to restart the filter to take change into account.",
@@ -581,7 +585,7 @@ void ExtVideo::updateFilterOptions()
                  qtu( option ),
                  i_type );
 
-    vlc_object_release( p_obj );
+    if( p_obj ) vlc_object_release( p_obj );
 }
 
 #if 0
index 611f42cbe6bd7d71893b9708b92f11ce88c155f8..004096ac3a5643ee560f8751e04fd3f313530ccb 100644 (file)
@@ -101,13 +101,13 @@ static const char *const ppsz_pos_descriptions[] =
   N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
 
 vlc_module_begin();
-    set_description( N_("Logo video filter") );
-    set_capability( "video filter", 0 );
+    set_capability( "sub filter", 0 );
+    set_callbacks( CreateFilter, DestroyFilter );
+    set_description( N_("Logo sub filter") );
     set_shortname( N_("Logo overlay") );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_SUBPIC );
     add_shortcut( "logo" );
-    set_callbacks( Create, Destroy );
 
     add_file( CFG_PREFIX "file", NULL, NULL, FILE_TEXT, FILE_LONGTEXT, false );
     add_integer( CFG_PREFIX "x", 0, NULL, POSX_TEXT, POSX_LONGTEXT, true );
@@ -120,11 +120,11 @@ vlc_module_begin();
     add_integer( CFG_PREFIX "position", -1, NULL, POS_TEXT, POS_LONGTEXT, false );
         change_integer_list( pi_pos_values, ppsz_pos_descriptions, NULL );
 
-    /* subpicture filter submodule */
+    /* video output filter submodule */
     add_submodule();
-    set_capability( "sub filter", 0 );
-    set_callbacks( CreateFilter, DestroyFilter );
-    set_description( N_("Logo sub filter") );
+    set_capability( "video filter", 0 );
+    set_callbacks( Create, Destroy );
+    set_description( N_("Logo video filter") );
 vlc_module_end();
 
 static const char *const ppsz_filter_options[] = {