Skip to content
Snippets Groups Projects
Commit 85772a0e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Hugo Beauzée-Luyssen
Browse files

cli: print infos of playlist items (refs #24986)

This matches the Lua RC info semantics. If there is an argument print
the infos of the item with that index, rather than the playing item.
parent fd0cc5d3
No related branches found
No related tags found
1 merge request!1942cli: print playlist item infos
......@@ -518,8 +518,12 @@ static int PlaylistItemInfo(struct cli_client *cl, const char *const *args,
input_item_t *item;
vlc_playlist_Lock(playlist);
idx = vlc_playlist_GetCurrentIndex(playlist);
if (idx >= 0)
if (count >= 2)
idx = atoi(args[1]);
else
idx = vlc_playlist_GetCurrentIndex(playlist);
if ((size_t)idx < vlc_playlist_Count(playlist))
item = vlc_playlist_item_GetMedia(vlc_playlist_Get(playlist, idx));
else
item = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment