summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-09-04 14:48:39 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-09-04 14:48:39 +0200
commit1bc5ba817c785f6d99ab5e82a9b5f5be3238dd1c (patch)
treea323b5038b0265edfad42422a8d8534895bc1496 /device.c
parentc4ff05bbcaf8dd31ac88bdc76f2815da25ac08b0 (diff)
downloadvdr-1bc5ba817c785f6d99ab5e82a9b5f5be3238dd1c.tar.gz
vdr-1bc5ba817c785f6d99ab5e82a9b5f5be3238dd1c.tar.bz2
Changed the audio PID language codes to hold up to two 3 letter codes; automatic audio channel setting for two channel audio
Diffstat (limited to 'device.c')
-rw-r--r--device.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/device.c b/device.c
index 0ae2965d..8673cf05 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.108 2005/09/02 13:52:31 kls Exp $
+ * $Id: device.c 1.109 2005/09/04 14:28:16 kls Exp $
*/
#include "device.h"
@@ -795,13 +795,17 @@ void cDevice::EnsureAudioTrack(bool Force)
{
if (Force || !availableTracks[currentAudioTrack].id) {
eTrackType PreferredTrack = ttAudioFirst;
+ int PreferredAudioChannel = 0;
int LanguagePreference = -1;
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))
+ int pos = 0;
+ if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.AudioLanguages, TrackId->language, LanguagePreference, &pos)) {
PreferredTrack = eTrackType(i);
+ PreferredAudioChannel = pos;
+ }
if (Setup.CurrentDolby && i == ttDolbyLast) {
i = ttAudioFirst - 1;
EndCheck = ttAudioLast;
@@ -811,8 +815,9 @@ void cDevice::EnsureAudioTrack(bool Force)
const tTrackId *Track = GetTrack(GetCurrentAudioTrack());
if (Force || !Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) {
if (!Force) // only log this for automatic changes
- dsyslog("setting audio track to %d", PreferredTrack);
+ dsyslog("setting audio track to %d (%d)", PreferredTrack, PreferredAudioChannel);
SetCurrentAudioTrack(PreferredTrack);
+ SetAudioChannel(PreferredAudioChannel);
}
}
}