From dfe3edee762e9220c639888fc2a3b1113bdfcbf3 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 14 Oct 2024 12:55:53 -0500 Subject: [PATCH] player/sub: avoid pointlessly redecoding subs This was added in 8f043de961f5b57c60e61e49b1841ad20faa64fe but the redecode is a special case that is only ever needed for subtitles on a still image. Normal video never needs this so just modify the conditional to avoid doing more work. --- player/sub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/sub.c b/player/sub.c index 741f2ed0f9..c3bb0ee7a5 100644 --- a/player/sub.c +++ b/player/sub.c @@ -130,8 +130,8 @@ static bool update_subtitle(struct MPContext *mpctx, double video_pts, // Check if we need to update subtitles for these special cases. Always // update on discontinuities like seeking or a new file. if (sub_updated || mpctx->redraw_subs || osd_pts == MP_NOPTS_VALUE) { - // Always force a redecode of all packets if we have a refresh. - if (mpctx->redraw_subs) + // Always force a redecode of all packets if we seek on a still image. + if (mpctx->redraw_subs && still_image) sub_redecode_cached_packets(dec_sub); // Handle displaying subtitles on terminal; never done for secondary subs