#include <vlc_input.h>
#include <vlc_meta.h>
#include <vlc_playlist.h>
-#include <vlc_aout.h>
+#include <vlc_aout_intf.h>
#include <vlc_strings.h>
#include <vlc_url.h>
#include <vlc_charset.h>
+#include <vlc_fs.h>
#include <libvlc.h>
#include <errno.h>
break;
case 's':
{
- char *lang = NULL;
+ char *psz_lang = NULL;
if( p_input )
- lang = var_GetNonEmptyString( p_input, "sub-language" );
- if( lang == NULL )
- lang = strdup( b_empty_if_na ? "" : "-" );
- INSERT_STRING( lang );
+ psz_lang = var_GetNonEmptyString( p_input, "sub-language" );
+ if( psz_lang == NULL )
+ psz_lang = strdup( b_empty_if_na ? "" : "-" );
+ INSERT_STRING( psz_lang );
break;
}
case 't':
case 'Z':
if( p_item )
{
- char *now_playing = input_item_GetNowPlaying( p_item );
- if ( now_playing == NULL )
+ char *psz_now_playing = input_item_GetNowPlaying( p_item );
+ if ( psz_now_playing == NULL )
{
- char *temp = input_item_GetTitleFbName( p_item );
- if( !EMPTY_STR( temp ) )
+ char *psz_temp = input_item_GetTitleFbName( p_item );
+ char *psz_artist = input_item_GetArtist( p_item );
+ if( !EMPTY_STR( psz_temp ) )
{
- INSERT_STRING( temp );
- INSERT_STRING_NO_FREE( " - " );
+ INSERT_STRING( psz_temp );
+ if ( !EMPTY_STR( psz_artist ) )
+ INSERT_STRING_NO_FREE( " - " );
}
- INSERT_STRING( input_item_GetArtist( p_item ) );
+ INSERT_STRING( psz_artist );
}
else
- INSERT_STRING( now_playing );
+ INSERT_STRING( psz_now_playing );
}
break;
else
if (path[0] != DIR_SEP_CHAR)
{ /* Relative path: prepend the current working directory */
- char cwd[PATH_MAX];
+ char *cwd, *ret;
- if (getcwd (cwd, sizeof (cwd)) == NULL) /* FIXME: UTF8? */
+ if ((cwd = vlc_getcwd ()) == NULL)
return NULL;
- if (asprintf (&buf, "%s/%s", cwd, path) == -1)
- return NULL;
- char *ret = make_URI (buf, scheme);
+ if (asprintf (&buf, "%s"DIR_SEP"%s", cwd, path) == -1)
+ buf = NULL;
+
+ free (cwd);
+ ret = (buf != NULL) ? make_URI (buf, scheme) : NULL;
free (buf);
return ret;
}