diff options
author | wm4 <wm4@nowhere> | 2020-03-21 17:45:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-21 19:33:03 +0100 |
commit | 7e885a3bc3af4df93681b6e760a34e59e2f47ef7 (patch) | |
tree | c2687c6b364a2e5aeef0c466fb04988bafc35ab3 /player/loadfile.c | |
parent | 956a5d9ac61ffe4034abcc81405e8ecdacac8b36 (diff) | |
download | mpv-7e885a3bc3af4df93681b6e760a34e59e2f47ef7.tar.bz2 mpv-7e885a3bc3af4df93681b6e760a34e59e2f47ef7.tar.xz |
client API: add a playlist entry unique ID
This should make dealing with some async. things easier.
It's intentionally not a globally unique ID.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index 4d16a66376..46627a9b23 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1381,7 +1381,11 @@ static void play_current_file(struct MPContext *mpctx) if (mpctx->stop_play || !mpctx->playlist->current) return; - mp_notify(mpctx, MPV_EVENT_START_FILE, NULL); + mpv_event_start_file start_event = { + .playlist_entry_id = mpctx->playlist->current->id, + }; + + mp_notify(mpctx, MPV_EVENT_START_FILE, &start_event); mp_cancel_reset(mpctx->playback_abort); @@ -1653,7 +1657,9 @@ terminate_playback: bool nothing_played = !mpctx->shown_aframes && !mpctx->shown_vframes && mpctx->error_playing <= 0; - struct mpv_event_end_file end_event = {0}; + struct mpv_event_end_file end_event = { + .playlist_entry_id = start_event.playlist_entry_id, + }; switch (mpctx->stop_play) { case PT_ERROR: case AT_END_OF_FILE: |