From 48740dfec5303a390e223b0626daf4730f65f948 Mon Sep 17 00:00:00 2001 From: dudemanguy Date: Fri, 26 Oct 2018 09:51:47 -0500 Subject: osd: allow sub-text to work even if sub-visibility is disabled --- DOCS/man/input.rst | 6 +++--- player/osd.c | 2 +- sub/dec_sub.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 6798130b32..c187f791ad 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -1903,9 +1903,9 @@ Property list Last known OSD display pixel aspect (can be 0). ``sub-text`` - Return the current subtitle text. Formatting is stripped. If a subtitle - is selected, but no text is currently visible, or the subtitle is not - text-based (i.e. DVD/BD subtitles), an empty string is returned. + Return the current subtitle text regardless of sub visibility. + Formatting is stripped. If the subtitle is not text-based + (i.e. DVD/BD subtitles), an empty string is returned. This property is experimental and might be removed in the future. diff --git a/player/osd.c b/player/osd.c index c2af83b08c..2f1e5d5fb8 100644 --- a/player/osd.c +++ b/player/osd.c @@ -98,7 +98,7 @@ static void term_osd_update(struct MPContext *mpctx) void term_osd_set_subs(struct MPContext *mpctx, const char *text) { - if (mpctx->video_out || !text) + if (mpctx->video_out || !text || !mpctx->opts->subs_rend->sub_visibility) text = ""; // disable if (strcmp(mpctx->term_osd_subs ? mpctx->term_osd_subs : "", text) == 0) return; diff --git a/sub/dec_sub.c b/sub/dec_sub.c index 6a0a753076..410d5a3214 100644 --- a/sub/dec_sub.c +++ b/sub/dec_sub.c @@ -367,7 +367,7 @@ char *sub_get_text(struct dec_sub *sub, double pts) sub->last_vo_pts = pts; update_segment(sub); - if (opts->sub_visibility && sub->sd->driver->get_text) + if (sub->sd->driver->get_text) text = sub->sd->driver->get_text(sub->sd, pts); pthread_mutex_unlock(&sub->lock); return text; -- cgit v1.2.3