mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 17:42:17 +00:00
sub: always show subtitles on terminal with -no-video
Until now, this happened only when the -no-ass option was used. This difference in behavior doesn't make much sense, so change it so that whether -no-ass is used or not doesn't matter. (-no-ass enables the OSD subtitle renderer, which has the terminal fallback, while the normal path is video only.) the changes in set_osd_subtitle() and reinit_video_chain() are for resetting the state correctly when switching between video/no-video.
This commit is contained in:
parent
f3871193fc
commit
c1ac97b99b
@ -1515,6 +1515,8 @@ static void set_osd_subtitle(struct MPContext *mpctx, const char *text)
|
||||
set_osd_msg(mpctx, OSD_MSG_SUB_BASE, 1, INT_MAX, "%s", text);
|
||||
}
|
||||
}
|
||||
if (!text[0])
|
||||
rm_osd_msg(mpctx, OSD_MSG_SUB_BASE);
|
||||
}
|
||||
|
||||
// sym == mpctx->osd_function
|
||||
@ -1898,7 +1900,7 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl)
|
||||
}
|
||||
}
|
||||
|
||||
if (!mpctx->osd->render_bitmap_subs)
|
||||
if (!mpctx->osd->render_bitmap_subs || !mpctx->sh_video)
|
||||
set_osd_subtitle(mpctx, sub_get_text(dec_sub, curpts_s));
|
||||
}
|
||||
|
||||
@ -2481,7 +2483,7 @@ int reinit_video_chain(struct MPContext *mpctx)
|
||||
mpctx->delay = 0;
|
||||
mpctx->vo_pts_history_seek_ts++;
|
||||
|
||||
// ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============
|
||||
reset_subtitles(mpctx);
|
||||
|
||||
return 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user