sad

simple audio daemon
git clone git://git.2f30.org/sad
Log | Files | Refs | LICENSE

commit 0fe34b8aa0c626918e18a6f4c9642de152bdf8d7
parent 74db6f041d3290d3a3da7eed79ed1b1700d741fc
Author: sin <sin@2f30.org>
Date:   Thu, 25 Dec 2014 23:04:22 +0000

Only allow volume changes when we have a valid context

Diffstat:
Msndio.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sndio.c b/sndio.c @@ -18,9 +18,11 @@ sndioinit(void) static int sndiovol(int vol) { - if (!sio_setvol(hdl, (SIO_MAXVOL * vol) / 100)) { - warnx("sio_setvol: failed"); - return -1; + if (hdl) { + if (!sio_setvol(hdl, (SIO_MAXVOL * vol) / 100)) { + warnx("sio_setvol: failed"); + return -1; + } } return 0; }