summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-28 01:56:49 +0200
committerwm4 <wm4@nowhere>2012-10-30 20:10:24 +0100
commit62dc32250e586cb6b46e124a50de85805505e30f (patch)
tree7942e56f492340f489c604e20569b2510aacac9b /mplayer.c
parent6367ade0b069f1d9a646694a1420cb0363f2c585 (diff)
downloadmpv-62dc32250e586cb6b46e124a50de85805505e30f.tar.bz2
mpv-62dc32250e586cb6b46e124a50de85805505e30f.tar.xz
mplayer: fix multiline terminal OSD
When an OSD message printed to the terminal was multiple lines, the second line overwrote the status line. If that second line was shorter than the status line, awkward looking remains of the status line were left on the terminal. Fix this by writing an empty status line before printing the OSD message. This will clear the status line text. Also, print the status line again after the OSD message is printed - this makes output consistent with the single-line OSD message case. Remaining caveat: only the last line of a multiline OSD message is cleared when the OSD message is removed. But this is probably fine.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index fc8f17a346..a516c0bb4a 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1480,8 +1480,11 @@ static void update_osd_msg(struct MPContext *mpctx)
if (strcmp(mpctx->terminal_osd_text, msg->msg)) {
talloc_free(mpctx->terminal_osd_text);
mpctx->terminal_osd_text = talloc_strdup(mpctx, msg->msg);
+ // Multi-line message => clear what will be the second line
+ write_status_line(mpctx, "");
mp_msg(MSGT_CPLAYER, MSGL_STATUS, "%s%s\n", opts->term_osd_esc,
mpctx->terminal_osd_text);
+ print_status(mpctx, MP_NOPTS_VALUE, false);
}
}
return;