From 9cab16b4269a531fde38d797285ccde21cfe60fb Mon Sep 17 00:00:00 2001 From: aiju Date: Sat, 25 Aug 2012 22:33:51 +0200 Subject: games/gb: set audioproc priority --- sys/src/games/gb/audio.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/src/games/gb/audio.c b/sys/src/games/gb/audio.c index 898437446..0af1c0418 100644 --- a/sys/src/games/gb/audio.c +++ b/sys/src/games/gb/audio.c @@ -195,12 +195,27 @@ dosample(short *smp) if(f & 0x80) smp[1] += ch4s; } +void +setpri(int pri) +{ + char buf[64]; + int fd; + + snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid()); + if((fd = open(buf, OWRITE)) >= 0){ + fprint(fd, "pri %d\n", pri); + close(fd); + } +} + void audioproc(void *) { short samples[10 * 2]; int i; + setpri(13); + for(;;){ if(paused) memset(samples, 0, sizeof samples); -- cgit v1.2.3