mirror of https://github.com/mpv-player/mpv
vo_tct: add synchronized output support
See-Also: https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036
This commit is contained in:
parent
5a53fa7cad
commit
6177aa7616
|
@ -28,6 +28,8 @@
|
||||||
#define TERM_ESC_GOTO_YX "\033[%d;%df"
|
#define TERM_ESC_GOTO_YX "\033[%d;%df"
|
||||||
#define TERM_ESC_HIDE_CURSOR "\033[?25l"
|
#define TERM_ESC_HIDE_CURSOR "\033[?25l"
|
||||||
#define TERM_ESC_RESTORE_CURSOR "\033[?25h"
|
#define TERM_ESC_RESTORE_CURSOR "\033[?25h"
|
||||||
|
#define TERM_ESC_SYNC_UPDATE_BEGIN "\033[?2026h"
|
||||||
|
#define TERM_ESC_SYNC_UPDATE_END "\033[?2026l"
|
||||||
|
|
||||||
#define TERM_ESC_CLEAR_SCREEN "\033[2J"
|
#define TERM_ESC_CLEAR_SCREEN "\033[2J"
|
||||||
#define TERM_ESC_ALT_SCREEN "\033[?1049h"
|
#define TERM_ESC_ALT_SCREEN "\033[?1049h"
|
||||||
|
|
|
@ -275,6 +275,8 @@ static void flip_page(struct vo *vo)
|
||||||
if (vo->dwidth != width || vo->dheight != height)
|
if (vo->dwidth != width || vo->dheight != height)
|
||||||
reconfig(vo, vo->params);
|
reconfig(vo, vo->params);
|
||||||
|
|
||||||
|
printf(TERM_ESC_SYNC_UPDATE_BEGIN);
|
||||||
|
|
||||||
p->frame_buf.len = 0;
|
p->frame_buf.len = 0;
|
||||||
if (p->opts.algo == ALGO_PLAIN) {
|
if (p->opts.algo == ALGO_PLAIN) {
|
||||||
write_plain(&p->frame_buf,
|
write_plain(&p->frame_buf,
|
||||||
|
@ -291,6 +293,8 @@ static void flip_page(struct vo *vo)
|
||||||
bstr_xappend(NULL, &p->frame_buf, bstr0_s("\n"));
|
bstr_xappend(NULL, &p->frame_buf, bstr0_s("\n"));
|
||||||
if (p->opts.buffering <= VO_TCT_BUFFER_FRAME)
|
if (p->opts.buffering <= VO_TCT_BUFFER_FRAME)
|
||||||
print_buffer(&p->frame_buf);
|
print_buffer(&p->frame_buf);
|
||||||
|
|
||||||
|
printf(TERM_ESC_SYNC_UPDATE_END);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue