diff options
Diffstat (limited to 'contrib/ntp/libntp/audio.c')
-rw-r--r-- | contrib/ntp/libntp/audio.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/contrib/ntp/libntp/audio.c b/contrib/ntp/libntp/audio.c index 6f2262c..726dfa9 100644 --- a/contrib/ntp/libntp/audio.c +++ b/contrib/ntp/libntp/audio.c @@ -377,7 +377,9 @@ audio_gain( #ifdef PCM_STYLE_SOUND int l, r; - rval = 0; +# ifdef GCC + rval = 0; /* GCC thinks rval is used uninitialized */ +# endif r = l = 100 * gain / 255; /* Normalize to 0-100 */ # ifdef DEBUG @@ -392,10 +394,11 @@ audio_gain( if (cf_agc[0] != '\0') rval = ioctl(ctl_fd, agc, &l); else - if (2 == port) - rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_LINE, &l); - else - rval = ioctl(ctl_fd, SOUND_MIXER_WRITE_MIC, &l); + rval = ioctl(ctl_fd + , (2 == port) + ? SOUND_MIXER_WRITE_LINE + : SOUND_MIXER_WRITE_MIC + , &l); if (-1 == rval) { printf("audio_gain: agc write: %s\n", strerror(errno)); return rval; |