player/sub: avoid pointlessly redecoding subs

This was added in 8f043de961 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.
This commit is contained in:
Dudemanguy 2024-10-14 12:55:53 -05:00
parent 4c24eae220
commit dfe3edee76
1 changed files with 2 additions and 2 deletions

View File

@ -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