diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-10 03:00:14 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-10 03:00:14 +0200 |
commit | 240550bbb94653907faa6e0bb1c5ac3d279cc252 (patch) | |
tree | 1cd5346e52515dbeff187d040d79b92fae96caa9 /libvo/vo_fbdev.c | |
parent | 9895f2360fd5e8c48f21117d6934254317891cde (diff) | |
parent | fbb74e16a38d6a5af31a7fb369195988f7414766 (diff) | |
download | mpv-240550bbb94653907faa6e0bb1c5ac3d279cc252.tar.bz2 mpv-240550bbb94653907faa6e0bb1c5ac3d279cc252.tar.xz |
Merge svn changes up to r30848
Diffstat (limited to 'libvo/vo_fbdev.c')
-rw-r--r-- | libvo/vo_fbdev.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libvo/vo_fbdev.c b/libvo/vo_fbdev.c index 96a173938c..df3f21299c 100644 --- a/libvo/vo_fbdev.c +++ b/libvo/vo_fbdev.c @@ -554,9 +554,6 @@ char *fb_mode_name = NULL; static fb_mode_t *fb_mode = NULL; -/* vt related variables */ -static FILE *vt_fp = NULL; - /* vo_fbdev related variables */ static int fb_dev_fd; static int fb_tty_fd = -1; @@ -736,9 +733,11 @@ static void vt_set_textarea(int u, int l) int lrow = l / 16; mp_msg(MSGT_VO, MSGL_DBG2, "vt_set_textarea(%d,%d): %d,%d\n", u, l, urow, lrow); - if (vt_fp) { - fprintf(vt_fp, "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0); - fflush(vt_fp); + if (fb_tty_fd >= 0) { + char modestring[100]; + snprintf(modestring, sizeof(modestring), "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0); + write(fb_tty_fd, modestring, strlen(modestring)); + fsync(fb_tty_fd); } } @@ -973,9 +972,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, if (fs || vm) memset(frame_buffer, '\0', fb_line_len * fb_yres); } - if (!(vt_fp = fopen("/dev/tty", "w"))) { - mp_msg(MSGT_VO, MSGL_ERR, "can't fopen /dev/tty: %s\n", strerror(errno)); - } vt_set_textarea(last_row, fb_yres); @@ -1056,8 +1052,6 @@ static void uninit(void) mp_msg(MSGT_VO, MSGL_WARN, "Can't restore text mode: %s\n", strerror(errno)); } vt_set_textarea(0, fb_orig_vinfo.yres); - if (vt_fp) - fclose(vt_fp); close(fb_tty_fd); close(fb_dev_fd); if (frame_buffer) |