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 );
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" ) )
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.",
qtu( option ),
i_type );
- vlc_object_release( p_obj );
+ if( p_obj ) vlc_object_release( p_obj );
}
#if 0