Commit a63042d4 authored by Rémi Duraffort's avatar Rémi Duraffort

lua_playlist: Use the title of the item and fallback to the name if this one...

lua_playlist: Use the title of the item and fallback to the name if this one is empty (better for some sd like icecast).
parent e6e57eaa
...@@ -160,7 +160,6 @@ static int vlclua_playlist_enqueue( lua_State *L ) ...@@ -160,7 +160,6 @@ static int vlclua_playlist_enqueue( lua_State *L )
return 1; 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 ) static void push_playlist_item( lua_State *L, playlist_item_t *p_item )
{ {
input_item_t *p_input = p_item->p_input; 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 ) ...@@ -186,7 +185,9 @@ static void push_playlist_item( lua_State *L, playlist_item_t *p_item )
lua_setfield( L, -2, "flags" ); lua_setfield( L, -2, "flags" );
if( p_input ) 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_setfield( L, -2, "name" );
lua_pushstring( L, p_input->psz_uri ); lua_pushstring( L, p_input->psz_uri );
lua_setfield( L, -2, "path" ); lua_setfield( L, -2, "path" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment