summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-09 00:38:38 +0200
committerwm4 <wm4@nowhere>2014-09-09 01:23:10 +0200
commitc0fbab7a7cfcca8c1fa6ac5ea532924b35938923 (patch)
tree12830798510d03bbdef2c8663a7a1c63c92619ad /player/core.h
parent9cb1e2c58ca21f12b65167eb8a3640bda8eadfd5 (diff)
downloadmpv-c0fbab7a7cfcca8c1fa6ac5ea532924b35938923.tar.bz2
mpv-c0fbab7a7cfcca8c1fa6ac5ea532924b35938923.tar.xz
player: deal with some corner cases with playlist navigation
The purpose is making accessing the current playlist entry saner when commands are executed during initialization, termination, or after playlist navigation commands. For example, the "playlist_remove current" command will invalidate playlist->current - but some things still access the playlist entry even on uninit. Until now, checking stop_play implicitly took care of it, so it worked, but it was still messy. Introduce the mpctx->playing field, which points to the current playlist entry, even if the entry was removed and/or the playlist's current entry was moved (e.g. due to playlist navigation).
Diffstat (limited to 'player/core.h')
-rw-r--r--player/core.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/core.h b/player/core.h
index bd2a15d7d0..5c40e48674 100644
--- a/player/core.h
+++ b/player/core.h
@@ -187,7 +187,8 @@ typedef struct MPContext {
struct osd_progbar_state osd_progbar;
struct playlist *playlist;
- char *filename; // currently playing file
+ struct playlist_entry *playing; // currently playing file
+ char *filename; // always the same as playing->filename (or NULL)
struct mp_resolve_result *resolve_result;
enum stop_play_reason stop_play;
unsigned int initialized_flags; // which subsystems have been initialized