From 942829463410d0e7ab27b3191205ecfd3c132f2d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 May 2018 12:37:37 +0200 Subject: player: simplify edition switching The player fully restarts playback when the edition or disk title is changed. Before this, the player tried to reinitialized playback partially. For example, it did not print a new "Playing: " message, and did not send playback end to libmpv users (scripts or applications). This playback restart code was a bit messy and could have unforeseen interactions with various state. There have been bugs before. Since it's a mostly cosmetic thing for an obscure feature, just change it to a full restart. This works well, though since it may have consequences for scripts or client API users, mention it in interface-changes.rst. --- player/loadfile.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index 65d693e264..56aca7d30c 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1203,10 +1203,6 @@ static void play_current_file(struct MPContext *mpctx) MP_INFO(mpctx, "Playing: %s\n", mpctx->filename); -reopen_file: - - reset_playback_state(mpctx); - assert(mpctx->demuxer == NULL); process_hooks(mpctx, "on_load"); @@ -1398,12 +1394,6 @@ terminate_playback: mpctx->playback_initialized = false; - if (mpctx->stop_play == PT_RELOAD_FILE) { - mpctx->stop_play = KEEP_PLAYING; - mp_cancel_reset(mpctx->playback_abort); - goto reopen_file; - } - m_config_restore_backups(mpctx->mconfig); TA_FREEP(&mpctx->filter_root); -- cgit v1.2.3