}
/* same than INSERT_STRING, except that string won't be freed */
-#define INSERT_STRING_NO_FREE( check, string ) \
- if( check && string ) \
+#define INSERT_STRING_NO_FREE( string ) \
{ \
int len = strlen( string ); \
dst = realloc( dst, \
strncpy( d, string, len+1 ); \
d += len; \
free( string ); \
- } \
- else \
- { \
- *d = '-'; \
- d++; \
- }
+ }
char *__str_format_meta( vlc_object_t *p_object, const char *string )
{
const char *s = string;
{
sprintf( buf, b_empty_if_na ? "" : "-" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'C':
if( p_input )
{
sprintf( buf, b_empty_if_na ? "" : "-" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'D':
if( p_item )
{
sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'F':
INSERT_STRING( p_item, input_item_GetURI( p_item ) );
{
sprintf( buf, b_empty_if_na ? "" : "-" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'L':
if( p_item && p_input )
{
sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'N':
INSERT_STRING( p_item, input_item_GetName( p_item ) );
{
sprintf( buf, b_empty_if_na ? "" : "--.-%%" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'R':
if( p_input )
{
sprintf( buf, b_empty_if_na ? "" : "-" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'S':
if( p_input )
{
sprintf( buf, b_empty_if_na ? "" : "-" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'T':
if( p_input )
{
sprintf( buf, b_empty_if_na ? "" : "--:--:--" );
}
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
case 'U':
INSERT_STRING( p_item, input_item_GetPublisher(p_item) );
audio_volume_t volume;
aout_VolumeGet( p_object, &volume );
snprintf( buf, 10, "%d", volume );
- INSERT_STRING_NO_FREE( 1, buf );
+ INSERT_STRING_NO_FREE( buf );
break;
}
case '_':