From d2d86672598abace04f392288b91129b24c085d6 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 14 Oct 2024 13:57:07 -0500 Subject: [PATCH] player: move a redraw_subs edgecase to loadfile Putting this in handle_osd_redraw was strange and my own comments didn't help me remember what this was even for. The actual purpose here is that the osd needs to be redrawn in the still image edge case as you go through a playlist. This is because all the logic with checking timestamps isn't applicable and we need to essentially clear the screen with another redraw. Clearly, it makes more sense for this to be done when a new file is successfully loaded and not in the osd_redraw where that happens to work but was called repeatedly pointlessly. --- player/loadfile.c | 3 +++ player/playloop.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/player/loadfile.c b/player/loadfile.c index 57c134c1e4..8dee862812 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1803,6 +1803,9 @@ static void play_current_file(struct MPContext *mpctx) update_screensaver_state(mpctx); clear_playlist_paths(mpctx); + // Clear out subs from the previous file if the video track is a still image. + redraw_subs(mpctx); + if (watch_later) mp_delete_watch_later_conf(mpctx, mpctx->filename); diff --git a/player/playloop.c b/player/playloop.c index 770dee997d..b6b0ae4d65 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -659,9 +659,6 @@ static void handle_osd_redraw(struct MPContext *mpctx) if (!want_redraw) return; vo_redraw(mpctx->video_out); - // Even though we just redrew, it may need to be done again for certain - // cases of subtitles on an image. - redraw_subs(mpctx); } static void clear_underruns(struct MPContext *mpctx)