diff options
author | ods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-12-29 11:27:22 +0000 |
---|---|---|
committer | ods15 <ods15@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-12-29 11:27:22 +0000 |
commit | eaee93051a25350d4a185268f2e3439f43b804cc (patch) | |
tree | 61ae9f340ce11c8b089f924e03b66a16b8569c12 | |
parent | 8ae9b081919f29fe55140e382f881dba273f6c02 (diff) |
change erase to end of line, fall back to old behavior if no termcap found
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17259 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | mplayer.c | 10 | ||||
-rw-r--r-- | osdep/getch2-win.c | 2 | ||||
-rw-r--r-- | osdep/getch2.c | 5 |
3 files changed, 11 insertions, 6 deletions
@@ -962,8 +962,14 @@ static void print_status(float a_pos, float a_v, float corr) saddf(line, &pos, width, "%4.2fx ", playback_speed); // end - line[pos] = 0; - mp_msg(MSGT_AVSYNC, MSGL_STATUS, "%s%s\r", erase_to_end_of_line, line); + if (erase_to_end_of_line) { + line[pos] = 0; + mp_msg(MSGT_AVSYNC, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line); + } else { + memset(&line[pos], ' ', width - pos); + line[width] = 0; + mp_msg(MSGT_AVSYNC, MSGL_STATUS, "%s\r", line); + } free(line); } diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c index e6fb95ca91..449a44b7b4 100644 --- a/osdep/getch2-win.c +++ b/osdep/getch2-win.c @@ -22,7 +22,7 @@ int mp_input_win32_slave_cmd_func(int fd,char* dest,int size){ int screen_width=80; int screen_height=24; -char * erase_to_end_of_line = " \r"; +char * erase_to_end_of_line = NULL; void get_screen_size(){ } diff --git a/osdep/getch2.c b/osdep/getch2.c index ac9c5e8395..89f369e068 100644 --- a/osdep/getch2.c +++ b/osdep/getch2.c @@ -40,7 +40,7 @@ static char getch2_buf[BUF_LEN]; int screen_width=80; int screen_height=24; -char * erase_to_end_of_line = "\033[J"; +char * erase_to_end_of_line = NULL; typedef struct { int len; @@ -79,7 +79,6 @@ char *p=tgetstr(id,&term_p); static int success=0; int load_termcap(char *termtype){ - char * p; if(!termtype) termtype=getenv("TERM"); if(!termtype) termtype="unknown"; success=tgetent(term_buffer, termtype); @@ -90,7 +89,7 @@ int load_termcap(char *termtype){ screen_height=tgetnum("li"); if(screen_width<1 || screen_width>255) screen_width=80; if(screen_height<1 || screen_height>255) screen_height=24; - if ((p = tgetstr("cd",&term_p))) erase_to_end_of_line=p; + erase_to_end_of_line= tgetstr("cd",&term_p); termcap_add("kP",KEY_PGUP); termcap_add("kN",KEY_PGDWN); |