diff options
author | dudemanguy <random342@airmail.cc> | 2018-10-26 09:51:47 -0500 |
---|---|---|
committer | wm4 <1387750+wm4@users.noreply.github.com> | 2019-09-21 15:36:58 +0200 |
commit | 48740dfec5303a390e223b0626daf4730f65f948 (patch) | |
tree | 9576e09084fca777447164d34eb44df7cf94f931 | |
parent | 1591ccfff5871ef581d1d2992e9c517f29aaf301 (diff) | |
download | mpv-48740dfec5303a390e223b0626daf4730f65f948.tar.bz2 mpv-48740dfec5303a390e223b0626daf4730f65f948.tar.xz |
osd: allow sub-text to work even if sub-visibility is disabled
-rw-r--r-- | DOCS/man/input.rst | 6 | ||||
-rw-r--r-- | player/osd.c | 2 | ||||
-rw-r--r-- | 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; |