1
0
mirror of https://github.com/ericonr/sndio.git synced 2024-02-18 04:45:21 -06:00

sio_oss.c: Disallow tiny fragment sizes, as they may overload

the system. And as sndiod runs with increased priority, it would
consume all the cpu and could in turn hang the system.
This commit is contained in:
Alexandre Ratchov 2016-11-05 07:14:46 +01:00
parent c25d86c7db
commit 8c95537698

View File

@ -459,7 +459,7 @@ sio_oss_setpar(struct sio_hdl *sh, struct sio_par *par)
} }
frag_max = round * hdl->chan * formats[i].bps; frag_max = round * hdl->chan * formats[i].bps;
frag_shift = 0; frag_shift = 8;
while (1 << (frag_shift + 1) <= frag_max) while (1 << (frag_shift + 1) <= frag_max)
frag_shift++; frag_shift++;