diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-01-08 13:53:30 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-01-08 13:53:30 +0100 |
commit | f79f81dfd4e5e482f251f0ae53731cd8c6a42d2f (patch) | |
tree | 7db76aee7534e83bae7ee5e5004441ba171f5707 /device.c | |
parent | ec27c329cfeacf4687197f637d6abddd6fed25a8 (diff) | |
download | vdr-f79f81dfd4e5e482f251f0ae53731cd8c6a42d2f.tar.gz vdr-f79f81dfd4e5e482f251f0ae53731cd8c6a42d2f.tar.bz2 |
Implemented Setup.CurrentDolby
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.71 2005/01/08 10:15:00 kls Exp $ + * $Id: device.c 1.72 2005/01/08 13:48:19 kls Exp $ */ #include "device.h" @@ -541,6 +541,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) if (Result == scrOk) { if (LiveView && IsPrimaryDevice()) { + currentChannel = Channel->Number(); // Set the available audio tracks: ClrAvailableTracks(); currentAudioTrack = ttAudioFirst; @@ -551,16 +552,21 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) // Select the preferred audio track: eTrackType PreferredTrack = ttAudioFirst; int LanguagePreference = -1; - for (int i = ttAudioFirst; i <= ttDolbyLast; i++) { + int StartCheck = Setup.CurrentDolby ? ttDolbyFirst : ttAudioFirst; + int EndCheck = ttDolbyLast; + for (int i = StartCheck; i <= EndCheck; i++) { const tTrackId *TrackId = GetTrack(eTrackType(i)); if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.AudioLanguages, I18nLanguageIndex(TrackId->language), LanguagePreference)) PreferredTrack = eTrackType(i); + if (Setup.CurrentDolby && i == ttDolbyLast) { + i = ttAudioFirst - 1; + EndCheck = ttAudioLast; + } } // Make sure we're set to an available audio track: const tTrackId *Track = GetTrack(GetCurrentAudioTrack()); if (!Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) SetCurrentAudioTrack(PreferredTrack); - currentChannel = Channel->Number(); } cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull } |