]> git.sesse.net Git - vlc/blobdiff - src/text/strings.c
New pixmaps for play/pause/next/previous/stop.
[vlc] / src / text / strings.c
index a9a8d79eed1a6654020cfb3c8bc7e044c76f1073..5d1395782375435cf10a18dedb84537c235b7578 100644 (file)
@@ -30,7 +30,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <assert.h>
 
 /* Needed by str_format_time */
@@ -618,23 +618,14 @@ char *str_format_time( const char *tformat )
 {
     char buffer[255];
     time_t curtime;
-#if defined(HAVE_LOCALTIME_R)
     struct tm loctime;
-#else
-    struct tm *loctime;
-#endif
 
     /* Get the current time.  */
     curtime = time( NULL );
 
     /* Convert it to local time representation.  */
-#if defined(HAVE_LOCALTIME_R)
     localtime_r( &curtime, &loctime );
     strftime( buffer, 255, tformat, &loctime );
-#else
-    loctime = localtime( &curtime );
-    strftime( buffer, 255, tformat, loctime );
-#endif
     return strdup( buffer );
 }
 
@@ -668,21 +659,19 @@ char *__str_format_meta( vlc_object_t *p_object, const char *string )
     int b_empty_if_na = 0;
     char buf[10];
     int i_size = strlen( string ) + 1; /* +1 to store '\0' */
-    char *dst = malloc( i_size );
+    char *dst = strdup( string );
+    if( !dst ) return NULL;
     int d = 0;
 
     playlist_t *p_playlist = pl_Yield( p_object );
-    input_thread_t *p_input = p_playlist->p_input;
+    input_thread_t *p_input = playlist_CurrentInput( p_playlist );
     input_item_t *p_item = NULL;
     pl_Release( p_object );
     if( p_input )
     {
-        vlc_object_yield( p_input );
         p_item = input_GetItem(p_input);
     }
 
-    sprintf( dst, string );
-
     while( *s )
     {
         if( b_is_format )