/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* malloc(), free() */
-#include <string.h> /* strdup() */
#include <errno.h>
#include <vlc/vlc.h>
if( p_input )
{
- if( !EMPTY_STR( input_item_GetTitle( input_GetItem(p_input) ) ) )
+ psz_title = input_item_GetTitle( input_GetItem( p_input ) );
+ if( EMPTY_STR( psz_title ) )
{
- psz_title = strdup( input_item_GetTitle( input_GetItem(p_input) ) );
- }
- else
- {
- char *psz = strrchr( input_GetItem(p_input)->psz_uri, '/' );
+ free( psz_title );
+ char *psz_orig = input_item_GetURI( input_GetItem( p_input ) );
+ char *psz = strrchr( psz_orig, '/' );
if( psz )
{
}
else
{
- psz = input_GetItem(p_input)->psz_uri;
+ psz = psz_orig;
}
if( psz && *psz )
{
psz_title = strdup( psz );
}
+ free( psz_orig );
}
vlc_object_release( p_input );
}