]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/extended_panels.cpp
Qt4: Really split the TimeLabel into its own class.
[vlc] / modules / gui / qt4 / components / extended_panels.cpp
index 8accbf94356d96b2cdb848fb6eef13ab900d36ae..0feb32e2f1e2d912079ec87c7ecabb4eca6ca0d8 100644 (file)
@@ -250,34 +250,32 @@ 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 );
+    module_t *p_obj = module_find( p_intf, psz_name );
     if( !p_obj )
     {
         msg_Err( p_intf, "Unable to find filter module \"%s\n.", psz_name );
         return;
     }
 
-    if( module_IsCapable( p_obj, "video filter2" ) )
+    if( module_provides( p_obj, "video filter2" ) )
     {
         psz_filter_type = "video-filter";
     }
-    else if( module_IsCapable( p_obj, "video filter" ) )
+    else if( module_provides( p_obj, "video filter" ) )
     {
         psz_filter_type = "vout-filter";
     }
-    else if( module_IsCapable( p_obj, "sub filter" ) )
+    else if( module_provides( p_obj, "sub filter" ) )
     {
         psz_filter_type = "sub-filter";
     }
     else
     {
-        module_Put( p_obj );
+        module_release (p_obj);
         msg_Err( p_intf, "Unknown video filter type." );
         return;
     }
-    module_Put( p_obj );
+    module_release (p_obj);
 
     psz_string = config_GetPsz( p_intf, psz_filter_type );
 
@@ -343,6 +341,10 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
     if( THEMIM->getInput() )
         p_vout = ( vout_thread_t * )vlc_object_find( THEMIM->getInput(),
                 VLC_OBJECT_VOUT, FIND_CHILD );
+    /* If you have stopped the video, p_vout is still at its old value */
+    else
+        p_vout = NULL;
+
     if( p_vout )
     {
         if( !strcmp( psz_filter_type, "sub-filter" ) )
@@ -500,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.",
@@ -577,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