mirror of https://github.com/mpv-player/mpv
osd: allow sub-text to work even if sub-visibility is disabled
This commit is contained in:
parent
1591ccfff5
commit
48740dfec5
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue