summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-10-12 14:29:46 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-10-12 14:29:46 +0200
commitec5795bda2aae521c81e101ec109b8bc74e3e19d (patch)
treec113e0544ca27bd9f7c9e633b711142fbc556058 /dvbdevice.c
parent371b9be00bf3a6e301e9709bb9afd4294ea7a1dc (diff)
downloadvdr-ec5795bda2aae521c81e101ec109b8bc74e3e19d.tar.gz
vdr-ec5795bda2aae521c81e101ec109b8bc74e3e19d.tar.bz2
Reactivated full handling of second audio PID (even in 'Transfer Mode')
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index 418e3c89..a4a4308d 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 1.23 2002/10/11 12:49:12 kls Exp $
+ * $Id: dvbdevice.c 1.24 2002/10/12 11:15:45 kls Exp $
*/
#include "dvbdevice.h"
@@ -130,6 +130,8 @@ cDvbDevice::cDvbDevice(int n)
else
esyslog("ERROR: can't open DVB device %d", n);
+ aPid1 = aPid2 = 0;
+
source = -1;
frequency = -1;
diseqcCommands = NULL;
@@ -722,6 +724,8 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// PID settings:
if (TurnOnLivePIDs) {
+ aPid1 = Channel->Apid1();
+ aPid2 = Channel->Apid2();
if (!(AddPid(Channel->Apid1(), ptAudio) && AddPid(Channel->Vpid(), ptVideo))) {//XXX+ dolby dpid1!!! (if audio plugins are attached)
esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->Number(), CardIndex() + 1);
return false;
@@ -756,6 +760,36 @@ void cDvbDevice::SetVolumeDevice(int Volume)
}
}
+int cDvbDevice::NumAudioTracksDevice(void) const
+{
+ int n = 0;
+ if (aPid1)
+ n++;
+ if (aPid2 && aPid1 != aPid2)
+ n++;
+ return n;
+}
+
+const char **cDvbDevice::GetAudioTracksDevice(int *CurrentTrack) const
+{
+ if (NumAudioTracks()) {
+ if (CurrentTrack)
+ *CurrentTrack = (pidHandles[ptAudio].pid == aPid1) ? 0 : 1;
+ static const char *audioTracks1[] = { "Audio 1", NULL };
+ static const char *audioTracks2[] = { "Audio 1", "Audio 2", NULL };
+ return NumAudioTracks() > 1 ? audioTracks2 : audioTracks1;
+ }
+ return NULL;
+}
+
+void cDvbDevice::SetAudioTrackDevice(int Index)
+{
+ if (0 <= Index && Index < NumAudioTracks()) {
+ DelPid(pidHandles[ptAudio].pid);
+ AddPid(Index ? aPid2 : aPid1, ptAudio);
+ }
+}
+
bool cDvbDevice::SetPlayMode(ePlayMode PlayMode)
{
if (PlayMode != pmExtern_THIS_SHOULD_BE_AVOIDED && fd_video < 0 && fd_audio < 0) {