games/gb: set audioproc priority

This commit is contained in:
aiju 2012-08-25 22:33:51 +02:00
parent d7c21149e4
commit 9cab16b426

View file

@ -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);