[vlc-devel] commit: Fix use of logo and erase filters in the Qt extended intf. ( Antoine Cellerier )
git version control
git at videolan.org
Tue Sep 9 19:48:38 CEST 2008
vlc | branch: 0.9-bugfix | Antoine Cellerier <dionoea at videolan.org> | Tue Sep 9 19:50:16 2008 +0200| [e2c94f839e3fe9ee01d2b1a5917b1d658ae47979] | committer: Antoine Cellerier
Fix use of logo and erase filters in the Qt extended intf.
(cherry picked from commit d46ea102817e0146d74fc4789c57ef71b5bf9d33)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e2c94f839e3fe9ee01d2b1a5917b1d658ae47979
---
modules/gui/qt4/components/extended_panels.cpp | 18 +++++++++++-------
modules/video_filter/logo.c | 14 +++++++-------
2 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt4/components/extended_panels.cpp b/modules/gui/qt4/components/extended_panels.cpp
index 04d07f1..ab69ced 100644
--- a/modules/gui/qt4/components/extended_panels.cpp
+++ b/modules/gui/qt4/components/extended_panels.cpp
@@ -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
diff --git a/modules/video_filter/logo.c b/modules/video_filter/logo.c
index 0cfaff7..aada47a 100644
--- a/modules/video_filter/logo.c
+++ b/modules/video_filter/logo.c
@@ -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[] = {
More information about the vlc-devel
mailing list