# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_filter.h>
"means less transparency. The default is being not transparent " \
"(value 255) the minimum is fully transparent (value 0)." )
-static int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
-static const char *ppsz_pos_descriptions[] =
+static const int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 };
+static const char *const ppsz_pos_descriptions[] =
{ N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"),
N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") };
OSD_ALPHA_TEXT, OSD_ALPHA_LONGTEXT, true );
set_capability( "sub filter", 100 );
- set_description( _("On Screen Display menu") );
- set_shortname( _("OSD menu") );
+ set_description( N_("On Screen Display menu") );
+ set_shortname( N_("OSD menu") );
add_shortcut( "osdmenu" );
set_category( CAT_VIDEO );
p_filter->p_sys = p_sys = (filter_sys_t *) malloc( sizeof(filter_sys_t) );
if( !p_filter->p_sys )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
memset( p_sys, 0, sizeof(filter_sys_t) );
/* Populating struct */
p_sys->p_menu->i_x = 0;
p_sys->p_menu->i_y = 0;
}
- else if( (p_sys->i_x >= 0) || (p_sys->i_y >= 0) )
+ else
{
p_sys->p_menu->i_x = p_sys->i_x;
p_sys->p_menu->i_y = p_sys->i_y;
}
- else if( (p_sys->p_menu->i_x < 0) ||
- (p_sys->p_menu->i_y < 0) )
- {
- p_sys->b_absolute = false;
- p_sys->p_menu->i_x = 0;
- p_sys->p_menu->i_y = 0;
- }
/* Set up p_filter */
p_sys->i_last_date = mdate();
osd_MenuDelete( p_this, p_sys->p_menu );
p_sys->p_menu = NULL;
+ free( p_sys->psz_path );
free( p_sys->psz_file );
free( p_sys );
return VLC_EGENERIC;
var_DelCallback( p_filter, OSD_CFG "update", OSDMenuCallback, p_sys );
var_DelCallback( p_filter, OSD_CFG "alpha", OSDMenuCallback, p_sys );
- var_DelCallback( p_sys->p_menu, "osd-menu-update",
- OSDMenuUpdateEvent, p_filter );
- var_DelCallback( p_sys->p_menu, "osd-menu-visible",
- OSDMenuVisibleEvent, p_filter );
+ if( p_sys )
+ {
+ var_DelCallback( p_sys->p_menu, "osd-menu-update",
+ OSDMenuUpdateEvent, p_filter );
+ var_DelCallback( p_sys->p_menu, "osd-menu-visible",
+ OSDMenuVisibleEvent, p_filter );
+ }
- if( p_sys->p_vout )
+ if( p_sys && p_sys->p_vout )
{
var_DelCallback( p_sys->p_vout, "mouse-x",
MouseEvent, p_sys );
var_Destroy( p_this, OSD_CFG "update" );
var_Destroy( p_this, OSD_CFG "alpha" );
- osd_MenuDelete( p_filter, p_sys->p_menu );
+ if( p_sys )
+ {
+ osd_MenuDelete( p_filter, p_sys->p_menu );
- free( p_sys->psz_file );
- free( p_sys );
+ free( p_sys->psz_path );
+ free( p_sys->psz_file );
+ free( p_sys );
+ }
}
/*****************************************************************************
return NULL; /* we are too early, so wait */
/* Allocate the subpicture internal data. */
- p_spu = p_filter->pf_sub_buffer_new( p_filter );
- if( !p_spu ) return NULL;
+ p_spu = filter_NewSubpicture( p_filter );
+ if( !p_spu )
+ return NULL;
p_spu->b_ephemer = true;
p_spu->b_fade = true;