#include <vlc_playlist.h>
#include <vlc_meta.h>
#include <vlc_interface.h>
+#include <vlc_url.h>
/*****************************************************************************
p_sys->app_name = CFSTR( "VLC media player" );
p_sys->notification_type = CFSTR( "New input playing" );
- const char *data_path = config_GetDataDir ();
+ char *data_path = config_GetDataDir ( p_this );
char buf[strlen (data_path) + sizeof ("/vlc48x48.png")];
snprintf (buf, sizeof (buf), "%s/vlc48x48.png", data_path);
+ free( data_path );
p_sys->default_icon = (CFDataRef) readFile( buf );
- playlist_t *p_playlist = pl_Hold( p_intf );
- var_AddCallback( p_playlist, "item-current", ItemChange, p_intf );
- pl_Release( p_intf );
+ var_AddCallback( pl_Get( p_intf ), "item-current", ItemChange, p_intf );
RegisterToGrowl( p_this );
return VLC_SUCCESS;
{
intf_sys_t *p_sys = ((intf_thread_t*)p_this)->p_sys;
+ var_DelCallback( pl_Get( p_this ), "item-current", ItemChange, p_this );
+
CFRelease( p_sys->default_icon );
CFRelease( p_sys->app_name );
CFRelease( p_sys->notification_type );
[p_sys->p_pool release];
free( p_sys );
-
- playlist_t *p_playlist = pl_Hold( p_this );
- var_DelCallback( p_playlist, "item-current", ItemChange, p_this );
- pl_Release( p_this );
}
/*****************************************************************************
else if( psz_artist )
i_ret = asprintf( &psz_tmp, "%s\n%s", psz_title, psz_artist );
else
- i_ret = asprintf( &psz_tmp, "%s", psz_title );
+ {
+ psz_tmp = strdup( psz_title );
+ if( psz_tmp == NULL )
+ i_ret = -1;
+ }
if( i_ret == -1 )
{
}
char *psz_arturl = input_item_GetArtURL( p_item );
+ if( psz_arturl )
+ {
+ char *psz = make_path( psz_arturl );
+ free( psz_arturl );
+ psz_arturl = psz;
+ }
CFDataRef art = NULL;
- if( psz_arturl && !strncmp( psz_arturl, "file://", 7 ) &&
- strlen( psz_arturl ) > 7 )
- art = (CFDataRef) readFile( psz_arturl + 7 );
+ if( psz_arturl )
+ art = (CFDataRef) readFile( psz_arturl );
free( psz_title );
free( psz_artist );
NotifyToGrowl( p_intf, psz_tmp, art );
if( art ) CFRelease( art );
+ free( psz_tmp );
vlc_object_release( p_input );
return VLC_SUCCESS;