mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
				synced 2023-10-10 17:16:51 +00:00 
			
		
		
		
	Mute pass-through, if volume is 0.
This commit is contained in:
		
							
								
								
									
										6
									
								
								audio.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								audio.c
									
									
									
									
									
								
							| @@ -848,16 +848,17 @@ static int AlsaPlayRingbuffer(void) | |||||||
| 	if (!avail) {			// full or buffer empty | 	if (!avail) {			// full or buffer empty | ||||||
| 	    break; | 	    break; | ||||||
| 	} | 	} | ||||||
| 	if (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3) { | 	// muting ac3, can produce disturbance | ||||||
|  | 	if (AudioMute || (AudioSoftVolume && !AudioRing[AudioRingRead].UseAc3)) { | ||||||
| 	    // FIXME: quick&dirty cast | 	    // FIXME: quick&dirty cast | ||||||
| 	    AudioSoftAmplifier((int16_t *) p, avail); | 	    AudioSoftAmplifier((int16_t *) p, avail); | ||||||
| 	    // FIXME: if not all are written, we double amplify them | 	    // FIXME: if not all are written, we double amplify them | ||||||
| 	} | 	} | ||||||
| 	frames = snd_pcm_bytes_to_frames(AlsaPCMHandle, avail); | 	frames = snd_pcm_bytes_to_frames(AlsaPCMHandle, avail); | ||||||
|  | #ifdef DEBUG | ||||||
| 	if (avail != snd_pcm_frames_to_bytes(AlsaPCMHandle, frames)) { | 	if (avail != snd_pcm_frames_to_bytes(AlsaPCMHandle, frames)) { | ||||||
| 	    Error(_("audio/alsa: bytes lost -> out of sync\n")); | 	    Error(_("audio/alsa: bytes lost -> out of sync\n")); | ||||||
| 	} | 	} | ||||||
| #ifdef DEBUG |  | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| 	for (;;) { | 	for (;;) { | ||||||
| @@ -3897,6 +3898,7 @@ int64_t AudioGetClock(void) | |||||||
| void AudioSetVolume(int volume) | void AudioSetVolume(int volume) | ||||||
| { | { | ||||||
|     AudioVolume = volume; |     AudioVolume = volume; | ||||||
|  |     AudioMute = !volume; | ||||||
| #ifdef USE_AUDIORING | #ifdef USE_AUDIORING | ||||||
|     // reduce loudness for stereo output |     // reduce loudness for stereo output | ||||||
|     if (AudioStereoDescent && AudioRing[AudioRingRead].InChannels == 2 |     if (AudioStereoDescent && AudioRing[AudioRingRead].InChannels == 2 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user