summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-04 00:17:51 +0200
committerwm4 <wm4@nowhere>2013-06-04 00:21:57 +0200
commitc1ac97b99b3e80bbf84ed540178dd6689ead0b87 (patch)
tree7c0bbf9e4fd33422e13c648c6b414b11cc74543e /core
parentf3871193fcfc5feaee42c883496fa5f8f99eb4f5 (diff)
downloadmpv-c1ac97b99b3e80bbf84ed540178dd6689ead0b87.tar.bz2
mpv-c1ac97b99b3e80bbf84ed540178dd6689ead0b87.tar.xz
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.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c6
1 files changed, 4 insertions, 2 deletions
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;