#define COLOUR_TEXT N_("Color")
#define COLOUR_LONGTEXT N_("Color used to display text in the XOSD output.")
-vlc_module_begin();
- set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_CONTROL );
- set_description( N_("XOSD interface") );
- set_shortname( "XOSD" );
- add_bool( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT, true );
- add_integer( "xosd-text-offset", 30, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT, true );
+vlc_module_begin ()
+ set_category( CAT_INTERFACE )
+ set_subcategory( SUBCAT_INTERFACE_CONTROL )
+ set_description( N_("XOSD interface") )
+ set_shortname( "XOSD" )
+ add_bool( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT, true )
+ add_integer( "xosd-text-offset", 30, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT, true )
add_integer( "xosd-shadow-offset", 2, NULL,
- SHD_OFS_TEXT, SHD_OFS_LONGTEXT, true );
+ SHD_OFS_TEXT, SHD_OFS_LONGTEXT, true )
add_string( "xosd-font",
"-adobe-helvetica-bold-r-normal-*-*-160-*-*-p-*-iso8859-1",
- NULL, FONT_TEXT, FONT_LONGTEXT, true );
+ NULL, FONT_TEXT, FONT_LONGTEXT, true )
add_string( "xosd-colour", "LawnGreen",
- NULL, COLOUR_TEXT, COLOUR_LONGTEXT, true );
- set_capability( "interface", 10 );
- set_callbacks( Open, Close );
-vlc_module_end();
+ NULL, COLOUR_TEXT, COLOUR_LONGTEXT, true )
+ set_capability( "interface", 10 )
+ set_callbacks( Open, Close )
+vlc_module_end ()
/*****************************************************************************
* Open: initialize and create stuff
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
xosd *p_osd;
- char *psz_font, psz_colour;
+ char *psz_font, *psz_colour;
/* Allocate instance and initialize some members */
p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
- {
- msg_Err( p_intf, "out of memory" );
return VLC_ENOMEM;
- }
if( getenv( "DISPLAY" ) == NULL )
{
msg_Err( p_intf, "no display, please set the DISPLAY variable" );
+ free( p_intf->p_sys );
return VLC_EGENERIC;
}
if( p_intf->p_sys->p_osd == NULL )
{
msg_Err( p_intf, "couldn't initialize libxosd" );
+ free( p_intf->p_sys );
return VLC_EGENERIC;
}
#else
if( p_osd == NULL )
{
msg_Err( p_intf, "couldn't initialize libxosd" );
+ free( p_intf->p_sys );
return VLC_EGENERIC;
}
#endif
- playlist_t *p_playlist = pl_Yield( p_intf );
+ playlist_t *p_playlist = pl_Hold( p_intf );
var_AddCallback( p_playlist, "playlist-current", PlaylistNext, p_this );
var_AddCallback( p_playlist, "item-change", PlaylistNext, p_this );
pl_Release( p_intf );
static void Close( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
- playlist_t *p_playlist = pl_Yield( p_intf );
+ playlist_t *p_playlist = pl_Hold( p_intf );
var_DelCallback( p_playlist, "playlist-current", PlaylistNext, p_this );
var_DelCallback( p_playlist, "item-change", PlaylistNext, p_this );
pl_Release( p_intf );
if( p_intf->p_sys->b_need_update == true )
{
p_intf->p_sys->b_need_update = false;
- p_playlist = pl_Yield( p_intf );
+ p_playlist = pl_Hold( p_intf );
if( playlist_IsEmpty( p_playlist ) )
{
}
free( psz_display );
psz_display = NULL;
- if( p_playlist->status.i_status == PLAYLIST_STOPPED )
+ int i_status = playlist_Status( p_playlist );
+ if( i_status == PLAYLIST_STOPPED )
{
psz_display = strdup(_("Stop"));
pl_Release( p_intf );
}
- else if( p_playlist->status.i_status == PLAYLIST_PAUSED )
+ else if( i_status == PLAYLIST_PAUSED )
{
psz_display = strdup(_("Pause"));
pl_Release( p_intf );
}
else
{
- p_item = p_playlist->status.p_item;
+ p_item = playlist_CurrentPlayingItem( p_playlist );
p_input = p_item->p_input;
pl_Release( p_intf );
sprintf( psz_duration," " );
}
- psz_display = (char *)malloc( sizeof(char )*
+ psz_display = (char *)malloc(
(strlen( p_input->psz_name ) +
MSTRTIME_MAX_SIZE + 2+6 + 10 +10 ));
sprintf( psz_display,"%s %s",