mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
command: playlist property: return if an entry is currently playing
This actually doesn't even write/return the new sub-property, because I dislike the idea of dumping that field for every single playlist entry, even though it's "needed" only for one. Fixes #1260.
This commit is contained in:
@@ -2849,8 +2849,10 @@ static int get_playlist_entry(int item, int action, void *arg, void *ctx)
|
||||
if (!e)
|
||||
return M_PROPERTY_ERROR;
|
||||
|
||||
bool playing = e == mpctx->playing;
|
||||
struct m_sub_property props[] = {
|
||||
{"filename", SUB_PROP_STR(e->filename)},
|
||||
{"playing", SUB_PROP_FLAG(1), .unavailable = !playing},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user