Also inline str_format().
VLC_API char * vlc_b64_decode( const char *psz_src );
VLC_API char * str_format_time( const char * );
-VLC_API char * str_format_meta( vlc_object_t *, const char * );
-#define str_format_meta( a, b ) str_format_meta( VLC_OBJECT( a ), b )
-VLC_API char * str_format( vlc_object_t *, const char * );
-#define str_format( a, b ) str_format( VLC_OBJECT( a ), b )
+VLC_API char * str_format_meta( playlist_t *, const char * );
+
+static inline char *str_format( playlist_t *pl, const char *fmt )
+{
+ char *s1 = str_format_time( fmt );
+ char *s2 = str_format_meta( pl, s1 );
+ free( s1 );
+ return s2;
+}
VLC_API void filename_sanitize( char * );
VLC_API void path_sanitize( char * );
/* Try to get the nowplaying */
char *format = var_InheritString( p_intf, "input-title-format" );
- char *formated = str_format_meta( p_input, format );
+ char *formated = str_format_meta( THEPL, format );
free( format );
name = qfu(formated);
free( formated );
#include <vlc_fs.h>
#include <vlc_strings.h>
#include <vlc_modules.h>
+#include <vlc_playlist.h> // FIXME
/*****************************************************************************
* Local prototypes
{
closedir( path );
- char *psz_tmp = str_format( p_obj, psz_prefix );
+ char *psz_tmp = str_format( pl_Get(p_obj), psz_prefix );
if( !psz_tmp )
return NULL;
}
else
{
- psz_file = str_format( p_obj, psz_path );
+ psz_file = str_format( pl_Get(p_obj), psz_path );
path_sanitize( psz_file );
return psz_file;
}
stream_ReadLine
stream_UrlNew
stream_vaControl
-str_format
str_format_meta
str_format_time
str_duration
memcpy( dst+d, string, len ); \
d += len; \
}
-#undef str_format_meta
-char *str_format_meta( vlc_object_t *p_object, const char *string )
+char *str_format_meta( playlist_t *p_object, const char *string )
{
const char *s = string;
bool b_is_format = false;
if( !dst ) return NULL;
int d = 0;
- input_thread_t *p_input = playlist_CurrentInput( pl_Get(p_object) );
+ input_thread_t *p_input = playlist_CurrentInput( p_object );
input_item_t *p_item = NULL;
if( p_input )
{
#undef INSERT_STRING
#undef INSERT_STRING_NO_FREE
-#undef str_format
-/**
- * Apply str format time and str format meta
- */
-char *str_format( vlc_object_t *p_this, const char *psz_src )
-{
- char *psz_buf1, *psz_buf2;
- psz_buf1 = str_format_time( psz_src );
- psz_buf2 = str_format_meta( p_this, psz_buf1 );
- free( psz_buf1 );
- return psz_buf2;
-}
-
/**
* Remove forbidden, potentially forbidden and otherwise evil characters from
* filenames. This includes slashes, and popular characters like colon