From c1ac97b99b3e80bbf84ed540178dd6689ead0b87 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Jun 2013 00:17:51 +0200 Subject: 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. --- core/mplayer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/mplayer.c b/core/mplayer.c index 80ddd43f95..4d71b5f55f 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -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; -- cgit v1.2.3