summaryrefslogtreecommitdiff
path: root/audio.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-04-27 12:31:40 +0200
committerJohns <johns98@gmx.net>2012-04-27 12:31:40 +0200
commit5456164dce1d0cad73d895d8618fe7df4beaaf67 (patch)
treec98baf13f7e842d6f486f360028e86605411f336 /audio.c
parent6dd7c2680a21eca2e60b68be4d444f4b954f9444 (diff)
downloadvdr-plugin-softhddevice-5456164dce1d0cad73d895d8618fe7df4beaaf67.tar.gz
vdr-plugin-softhddevice-5456164dce1d0cad73d895d8618fe7df4beaaf67.tar.bz2
Mute pass-through, if volume is 0.
Diffstat (limited to 'audio.c')
-rw-r--r--audio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/audio.c b/audio.c
index 2da5d00..fffcb7d 100644
--- a/audio.c
+++ b/audio.c
@@ -848,16 +848,17 @@ static int AlsaPlayRingbuffer(void)
if (!avail) { // full or buffer empty
break;
}
- if (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3) {
+ // muting ac3, can produce disturbance
+ if (AudioMute || (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3)) {
// FIXME: quick&dirty cast
AudioSoftAmplifier((int16_t *) p, avail);
// FIXME: if not all are written, we double amplify them
}
frames = snd_pcm_bytes_to_frames(AlsaPCMHandle, avail);
+#ifdef DEBUG
if (avail != snd_pcm_frames_to_bytes(AlsaPCMHandle, frames)) {
Error(_("audio/alsa: bytes lost -> out of sync\n"));
}
-#ifdef DEBUG
#endif
for (;;) {
@@ -3586,7 +3587,7 @@ void AudioEnqueue(const void *samples, int count)
return; // no setup yet
}
if (AudioRing[AudioRingWrite].UseAc3) {
- buffer = (void*)samples;
+ buffer = (void *)samples;
} else {
//
// Convert / resample input to hardware format
@@ -3897,6 +3898,7 @@ int64_t AudioGetClock(void)
void AudioSetVolume(int volume)
{
AudioVolume = volume;
+ AudioMute = !volume;
#ifdef USE_AUDIORING
// reduce loudness for stereo output
if (AudioStereoDescent && AudioRing[AudioRingRead].InChannels == 2