]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/libs/playlist.c
Merge branch 'master' into lpcm_encoder
[vlc] / modules / misc / lua / libs / playlist.c
index f7d9d107f47cbefbd3e8497d0d51c95ff467c52e..df0f15c2b038c23c0f7cf105d0c9e0838e0777ac 100644 (file)
@@ -160,7 +160,6 @@ static int vlclua_playlist_enqueue( lua_State *L )
     return 1;
 }
 
-static void push_playlist_item( lua_State *L, playlist_item_t *p_item );
 static void push_playlist_item( lua_State *L, playlist_item_t *p_item )
 {
     input_item_t *p_input = p_item->p_input;
@@ -186,7 +185,9 @@ static void push_playlist_item( lua_State *L, playlist_item_t *p_item )
     lua_setfield( L, -2, "flags" );
     if( p_input )
     {
-        lua_pushstring( L, p_input->psz_name );
+        char *psz_name = input_item_GetTitleFbName( p_input );
+        lua_pushstring( L, psz_name );
+        free( psz_name );
         lua_setfield( L, -2, "name" );
         lua_pushstring( L, p_input->psz_uri );
         lua_setfield( L, -2, "path" );
@@ -338,16 +339,16 @@ static int vlclua_playlist_status( lua_State *L )
     switch( playlist_Status( p_playlist ) )
     {
         case PLAYLIST_STOPPED:
-            lua_pushstring( L, "stopped" );
+            lua_pushliteral( L, "stopped" );
             break;
         case PLAYLIST_RUNNING:
-            lua_pushstring( L, "playing" );
+            lua_pushliteral( L, "playing" );
             break;
         case PLAYLIST_PAUSED:
-            lua_pushstring( L, "paused" );
+            lua_pushliteral( L, "paused" );
             break;
         default:
-            lua_pushstring( L, "unknown" );
+            lua_pushliteral( L, "unknown" );
             break;
     }
     PL_UNLOCK;