1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Making sure the "Mute" and "Volume+/-" keys don't interfere with digital audio

This commit is contained in:
Klaus Schmidinger 2005-02-06 12:31:36 +01:00
parent 506eb479a5
commit 20b213201a
3 changed files with 8 additions and 4 deletions

View File

@ -3366,3 +3366,4 @@ Video Disk Recorder Revision History
replay of a recording that has no Dolby Digital audio after switching to a channel replay of a recording that has no Dolby Digital audio after switching to a channel
that has DD and selecting the DD audio track). that has DD and selecting the DD audio track).
- Removed 'flags' from tTrackId (thought we would need this, but apparently we don't). - Removed 'flags' from tTrackId (thought we would need this, but apparently we don't).
- Making sure the "Mute" and "Volume+/-" keys don't interfere with digital audio.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.83 2005/02/06 11:43:20 kls Exp $ * $Id: device.c 1.84 2005/02/06 12:30:01 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -646,6 +646,7 @@ void cDevice::ClrAvailableTracks(bool DescriptionsOnly)
memset(availableTracks, 0, sizeof(availableTracks)); memset(availableTracks, 0, sizeof(availableTracks));
pre_1_3_19_PrivateStream = false; pre_1_3_19_PrivateStream = false;
SetAudioChannel(0); // fall back to stereo SetAudioChannel(0); // fall back to stereo
currentAudioTrackMissingCount = 0;
} }
} }
@ -721,7 +722,7 @@ void cDevice::EnsureAudioTrack(bool Force)
} }
// Make sure we're set to an available audio track: // Make sure we're set to an available audio track:
const tTrackId *Track = GetTrack(GetCurrentAudioTrack()); const tTrackId *Track = GetTrack(GetCurrentAudioTrack());
if (!Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) { if (Force || !Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) {
dsyslog("setting audio track to %d", PreferredTrack); dsyslog("setting audio track to %d", PreferredTrack);
SetCurrentAudioTrack(PreferredTrack); SetCurrentAudioTrack(PreferredTrack);
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbdevice.c 1.116 2005/01/16 12:05:13 kls Exp $ * $Id: dvbdevice.c 1.117 2005/02/06 12:30:14 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -842,6 +842,8 @@ void cDvbDevice::SetAudioChannelDevice(int AudioChannel)
void cDvbDevice::SetVolumeDevice(int Volume) void cDvbDevice::SetVolumeDevice(int Volume)
{ {
if (HasDecoder()) { if (HasDecoder()) {
if (digitalAudio)
Volume = 0;
audio_mixer_t am; audio_mixer_t am;
// conversion for linear volume response: // conversion for linear volume response:
am.volume_left = am.volume_right = 2 * Volume - Volume * Volume / 255; am.volume_left = am.volume_right = 2 * Volume - Volume * Volume / 255;
@ -854,8 +856,8 @@ void cDvbDevice::SetDigitalAudioDevice(bool On)
if (digitalAudio != On) { if (digitalAudio != On) {
if (digitalAudio) if (digitalAudio)
cCondWait::SleepMs(1000); // Wait until any leftover digital data has been flushed cCondWait::SleepMs(1000); // Wait until any leftover digital data has been flushed
SetVolumeDevice(On || IsMute() ? 0 : CurrentVolume());
digitalAudio = On; digitalAudio = On;
SetVolumeDevice(On || IsMute() ? 0 : CurrentVolume());
} }
} }