~ft/treason

acc732ac0da6a971337d857b2789f05eb1a4aab4 — Sigrid Solveig Haflínudóttir 9 months ago c6f38fc
add stupid pause that does not sync audio and video (yet)
1 files changed, 12 insertions(+), 2 deletions(-)

M main.c
M main.c => main.c +12 -2
@@ 25,6 25,7 @@ static Channel *audiosync;
static Channel *audiofinished;
static char info[256];
static int showinfo;
static int paused;
static uvlong dispdelay;
static int framedrop;
static uvlong late;


@@ 43,7 44,7 @@ audioproc(void *x)
		fprint(2, "runaudio: %r\n");
	}else{
		for(s = x; Sread(s, &f) == 0 && f.sz > 0;){
			if(!synced){
			if(!synced || paused){
				recvp(audiosync);
				chanclose(audiosync);
				synced = 1;


@@ 381,7 382,16 @@ threadmain(int argc, char **argv)
			case Ckeyboard:
				end = key == 'q' || key == Kdel;
				done = key == '\n';
				showinfo = key == 'i' ? !showinfo : showinfo;
				showinfo ^= key == 'i';
				if(key == 'p'){
					if(!paused){
						audiosync = chancreate(sizeof(void*), 1);
						a[Cframe].op = CHANNOP;
					}else{
						a[Cframe].op = CHANRCV;
					}
					paused ^= 1;
				}
				forced = 1;
				break;