summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-16 14:24:15 +0200
committerwm4 <wm4@nowhere>2016-09-16 14:39:45 +0200
commit03fec24e192ea1b5c0cf957a5a64c0db9d33e67a (patch)
tree75f58b93ce56c3f6cd3afdbd3ce028f93dcf35bb /player/loadfile.c
parentb8ade7c99b830ee9870040bcfc1f2c3d3a64d172 (diff)
downloadmpv-03fec24e192ea1b5c0cf957a5a64c0db9d33e67a.tar.bz2
mpv-03fec24e192ea1b5c0cf957a5a64c0db9d33e67a.tar.xz
player: litter code with explicit wakeup calls
This does 3 kinds of changes: - change sleeptime=x to mp_set_timeout() - change sleeptime=0 to mp_wakeup_core() calls (to be more explicit) - change commands etc. to call mp_wakeup_core() if they do changes that require the playloop to be rerun This is preparation for the following changes. The goal is to process client API requests without having to rerun the playloop every time. As of this commit, the changes should not change behavior. In particular, the playloop is still implicitly woken up on every command.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index e89047f0aa..abce5b3168 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -473,6 +473,7 @@ void mp_switch_track_n(struct MPContext *mpctx, int order, enum stream_type type
}
mp_notify(mpctx, MPV_EVENT_TRACK_SWITCHED, NULL);
+ mp_wakeup_core(mpctx);
talloc_free(mpctx->track_layout_hash);
mpctx->track_layout_hash = talloc_steal(mpctx, track_layout_hash(mpctx));
@@ -1329,4 +1330,5 @@ void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e)
mpctx->playlist->current_was_replaced = false;
if (!mpctx->stop_play)
mpctx->stop_play = PT_CURRENT_ENTRY;
+ mp_wakeup_core(mpctx);
}