diff options
Diffstat (limited to 'player/osd.c')
-rw-r--r-- | player/osd.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/player/osd.c b/player/osd.c index 5bf7fa699b..96ab287227 100644 --- a/player/osd.c +++ b/player/osd.c @@ -22,7 +22,6 @@ #include <limits.h> #include <assert.h> -#include "config.h" #include "mpv_talloc.h" #include "common/msg.h" @@ -113,7 +112,7 @@ static void term_osd_update_title(struct MPContext *mpctx) void term_osd_set_subs(struct MPContext *mpctx, const char *text) { - if (mpctx->video_out || !text || !mpctx->opts->subs_rend->sub_visibility) + if (mpctx->video_out || !text || !mpctx->opts->subs_shared->sub_visibility[0]) text = ""; // disable if (strcmp(mpctx->term_osd_subs ? mpctx->term_osd_subs : "", text) == 0) return; @@ -135,11 +134,6 @@ static void term_osd_set_status_lazy(struct MPContext *mpctx, const char *text) { talloc_free(mpctx->term_osd_status); mpctx->term_osd_status = talloc_strdup(mpctx, text); - - int w = 80, h = 24; - terminal_get_size(&w, &h); - if (strlen(mpctx->term_osd_status) > w && !strchr(mpctx->term_osd_status, '\n')) - mpctx->term_osd_status[w] = '\0'; } static void add_term_osd_bar(struct MPContext *mpctx, char **line, int width) @@ -282,13 +276,10 @@ static void term_osd_print_status_lazy(struct MPContext *mpctx) if (!opts->use_terminal) return; - if (opts->quiet || !mpctx->playback_initialized || - !mpctx->playing_msg_shown || mpctx->stop_play) + if (opts->quiet || !mpctx->playback_initialized || !mpctx->playing_msg_shown) { - if (!mpctx->playing || mpctx->stop_play) { - mp_msg_flush_status_line(mpctx->log); + if (!mpctx->playing) term_osd_set_status_lazy(mpctx, ""); - } return; } @@ -460,7 +451,7 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, int level) } } -// OSD messages initated by seeking commands are added lazily with this +// OSD messages initiated by seeking commands are added lazily with this // function, because multiple successive seek commands can be coalesced. static void add_seek_osd_messages(struct MPContext *mpctx) { |