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

The PCR PID can now be set separately from the video PID

This commit is contained in:
Klaus Schmidinger 2003-04-26 11:58:54 +02:00
parent f53912de1e
commit fd0774c811
7 changed files with 45 additions and 16 deletions

View File

@ -2054,8 +2054,14 @@ Video Disk Recorder Revision History
your remote control while watching live video to start an instant recording your remote control while watching live video to start an instant recording
of the current programme and immediately start replaying that recording. of the current programme and immediately start replaying that recording.
2003-04-25: Version 1.1.29 2003-04-26: Version 1.1.29
- Fixed detecting broken connection to the LIRC daemon (thanks to Ludwig Nussel). - Fixed detecting broken connection to the LIRC daemon (thanks to Ludwig Nussel).
- Now sending CA descriptors to the CAM in the same sequence as they were originally - Now sending CA descriptors to the CAM in the same sequence as they were originally
received (thanks to Stefan Huelswitt). received (thanks to Stefan Huelswitt).
- The PCR PID can now be set separately from the video PID. The syntax in the
'channels.conf' file is, for example, ...:164+17:..., where 164 is the video PID
and 17 is the PCR PID. The separator is a '+' sign, not a comma or semicolon as
with the audio PIDs, because this is not an alternate PID, but rather an
additional, necessary PID. In order to use this feature you need a driver version
dated 2003-04-27 or higher (setting the PCR PID didn't work in earlier versions).

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: channels.c 1.11 2002/11/29 14:10:46 kls Exp $ * $Id: channels.c 1.12 2003/04/26 09:57:48 kls Exp $
*/ */
#include "channels.h" #include "channels.h"
@ -164,6 +164,7 @@ cChannel::cChannel(void)
source = cSource::FromString("S19.2E"); source = cSource::FromString("S19.2E");
srate = 27500; srate = 27500;
vpid = 255; vpid = 255;
ppid = 0;
apid1 = 256; apid1 = 256;
apid2 = 0; apid2 = 0;
dpid1 = 257; dpid1 = 257;
@ -286,8 +287,14 @@ const char *cChannel::ToText(cChannel *Channel)
asprintf(&buffer, ":%s\n", s); asprintf(&buffer, ":%s\n", s);
} }
else { else {
char vpidbuf[32];
char *q = vpidbuf;
q += snprintf(q, sizeof(vpidbuf), "%d", Channel->vpid);
if (Channel->ppid)
q += snprintf(q, sizeof(vpidbuf) - (q - vpidbuf), "+%d", Channel->ppid);
*q = 0;
char apidbuf[32]; char apidbuf[32];
char *q = apidbuf; q = apidbuf;
q += snprintf(q, sizeof(apidbuf), "%d", Channel->apid1); q += snprintf(q, sizeof(apidbuf), "%d", Channel->apid1);
if (Channel->apid2) if (Channel->apid2)
q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->apid2); q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->apid2);
@ -296,7 +303,7 @@ const char *cChannel::ToText(cChannel *Channel)
if (Channel->dpid2) if (Channel->dpid2)
q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->dpid2); q += snprintf(q, sizeof(apidbuf) - (q - apidbuf), ",%d", Channel->dpid2);
*q = 0; *q = 0;
asprintf(&buffer, "%s:%d:%s:%s:%d:%d:%s:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->ParametersToString(), cSource::ToString(Channel->source), Channel->srate, Channel->vpid, apidbuf, Channel->tpid, Channel->ca, Channel->sid, Channel->nid, Channel->tid, Channel->rid); asprintf(&buffer, "%s:%d:%s:%s:%d:%s:%s:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->ParametersToString(), cSource::ToString(Channel->source), Channel->srate, vpidbuf, apidbuf, Channel->tpid, Channel->ca, Channel->sid, Channel->nid, Channel->tid, Channel->rid);
} }
return buffer; return buffer;
} }
@ -326,8 +333,9 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID)
char *namebuf = NULL; char *namebuf = NULL;
char *sourcebuf = NULL; char *sourcebuf = NULL;
char *parambuf = NULL; char *parambuf = NULL;
char *vpidbuf = NULL;
char *apidbuf = NULL; char *apidbuf = NULL;
int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%d :%a[^:]:%d :%d :%d :%d :%d :%d ", &namebuf, &frequency, &parambuf, &sourcebuf, &srate, &vpid, &apidbuf, &tpid, &ca, &sid, &nid, &tid, &rid); int fields = sscanf(s, "%a[^:]:%d :%a[^:]:%a[^:] :%d :%a[^:]:%a[^:]:%d :%d :%d :%d :%d :%d ", &namebuf, &frequency, &parambuf, &sourcebuf, &srate, &vpidbuf, &apidbuf, &tpid, &ca, &sid, &nid, &tid, &rid);
if (fields >= 9) { if (fields >= 9) {
if (fields == 9) { if (fields == 9) {
// allow reading of old format // allow reading of old format
@ -335,12 +343,19 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID)
ca = tpid; ca = tpid;
tpid = 0; tpid = 0;
} }
vpid = ppid = 0;
apid1 = apid2 = 0; apid1 = apid2 = 0;
dpid1 = dpid2 = 0; dpid1 = dpid2 = 0;
bool ok = false; bool ok = false;
if (parambuf && sourcebuf && apidbuf) { if (parambuf && sourcebuf && vpidbuf && apidbuf) {
ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0; ok = StringToParameters(parambuf) && (source = cSource::FromString(sourcebuf)) >= 0;
char *p = strchr(apidbuf, ';'); char *p = strchr(vpidbuf, '+');
if (p)
*p++ = 0;
sscanf(vpidbuf, "%d", &vpid);
if (p)
sscanf(p, "%d", &ppid);
p = strchr(apidbuf, ';');
if (p) if (p)
*p++ = 0; *p++ = 0;
sscanf(apidbuf, "%d ,%d ", &apid1, &apid2); sscanf(apidbuf, "%d ,%d ", &apid1, &apid2);
@ -350,6 +365,7 @@ bool cChannel::Parse(const char *s, bool AllowNonUniqueID)
strn0cpy(name, namebuf, MaxChannelName); strn0cpy(name, namebuf, MaxChannelName);
free(parambuf); free(parambuf);
free(sourcebuf); free(sourcebuf);
free(vpidbuf);
free(apidbuf); free(apidbuf);
free(namebuf); free(namebuf);
if (!AllowNonUniqueID && Channels.GetByChannelID(GetChannelID())) { if (!AllowNonUniqueID && Channels.GetByChannelID(GetChannelID())) {

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: channels.h 1.6 2002/11/30 12:59:05 kls Exp $ * $Id: channels.h 1.7 2003/04/26 09:15:40 kls Exp $
*/ */
#ifndef __CHANNELS_H #ifndef __CHANNELS_H
@ -65,6 +65,7 @@ private:
int source; int source;
int srate; int srate;
int vpid; int vpid;
int ppid;
int apid1, apid2; int apid1, apid2;
int dpid1, dpid2; int dpid1, dpid2;
int tpid; int tpid;
@ -98,6 +99,7 @@ public:
int Source(void) const { return source; } int Source(void) const { return source; }
int Srate(void) const { return srate; } int Srate(void) const { return srate; }
int Vpid(void) const { return vpid; } int Vpid(void) const { return vpid; }
int Ppid(void) const { return ppid; }
int Apid1(void) const { return apid1; } int Apid1(void) const { return apid1; }
int Apid2(void) const { return apid2; } int Apid2(void) const { return apid2; }
int Dpid1(void) const { return dpid1; } int Dpid1(void) const { return dpid1; }

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.h 1.29 2003/01/03 15:43:48 kls Exp $ * $Id: device.h 1.30 2003/04/26 09:49:12 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -188,7 +188,7 @@ private:
bool active; bool active;
virtual void Action(void); virtual void Action(void);
protected: protected:
enum ePidType { ptAudio, ptVideo, ptTeletext, ptDolby, ptOther }; enum ePidType { ptAudio, ptVideo, ptPcr, ptTeletext, ptDolby, ptOther };
class cPidHandle { class cPidHandle {
public: public:
int pid; int pid;

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.54 2003/04/19 14:24:25 kls Exp $ * $Id: dvbdevice.c 1.55 2003/04/26 11:49:06 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -524,8 +524,8 @@ void cDvbDevice::SetVideoFormat(bool VideoFormat16_9)
CHECK(ioctl(fd_video, VIDEO_SET_FORMAT, VideoFormat16_9 ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3)); CHECK(ioctl(fd_video, VIDEO_SET_FORMAT, VideoFormat16_9 ? VIDEO_FORMAT_16_9 : VIDEO_FORMAT_4_3));
} }
// ptAudio ptVideo ptTeletext ptDolby ptOther // ptAudio ptVideo ptPcr ptTeletext ptDolby ptOther
dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER }; dmx_pes_type_t PesTypes[] = { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_PCR, DMX_PES_TELETEXT, DMX_PES_OTHER, DMX_PES_OTHER };
bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On) bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{ {
@ -662,6 +662,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
DelPid(pidHandles[ptAudio].pid); DelPid(pidHandles[ptAudio].pid);
DelPid(pidHandles[ptVideo].pid); DelPid(pidHandles[ptVideo].pid);
DelPid(pidHandles[ptPcr].pid);
DelPid(pidHandles[ptTeletext].pid); DelPid(pidHandles[ptTeletext].pid);
DelPid(pidHandles[ptDolby].pid); DelPid(pidHandles[ptDolby].pid);
} }
@ -683,7 +684,7 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
if (TurnOnLivePIDs) { if (TurnOnLivePIDs) {
aPid1 = Channel->Apid1(); aPid1 = Channel->Apid1();
aPid2 = Channel->Apid2(); aPid2 = Channel->Apid2();
if (!(AddPid(Channel->Apid1(), ptAudio) && AddPid(Channel->Vpid(), ptVideo))) {//XXX+ dolby dpid1!!! (if audio plugins are attached) if (!(AddPid(Channel->Ppid(), ptPcr) && 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); esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->Number(), CardIndex() + 1);
return false; return false;
} }

3
menu.c
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: menu.c 1.237 2003/04/21 14:57:13 kls Exp $ * $Id: menu.c 1.238 2003/04/26 11:50:14 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -575,6 +575,7 @@ void cMenuEditChannel::Setup(void)
Add(new cMenuEditSrcItem( tr("Source"), &data.source)); Add(new cMenuEditSrcItem( tr("Source"), &data.source));
Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency)); Add(new cMenuEditIntItem( tr("Frequency"), &data.frequency));
Add(new cMenuEditIntItem( tr("Vpid"), &data.vpid, 0, 0x1FFF)); Add(new cMenuEditIntItem( tr("Vpid"), &data.vpid, 0, 0x1FFF));
Add(new cMenuEditIntItem( tr("Ppid"), &data.ppid, 0, 0x1FFF));
Add(new cMenuEditIntItem( tr("Apid1"), &data.apid1, 0, 0x1FFF)); Add(new cMenuEditIntItem( tr("Apid1"), &data.apid1, 0, 0x1FFF));
Add(new cMenuEditIntItem( tr("Apid2"), &data.apid2, 0, 0x1FFF)); Add(new cMenuEditIntItem( tr("Apid2"), &data.apid2, 0, 0x1FFF));
Add(new cMenuEditIntItem( tr("Dpid1"), &data.dpid1, 0, 0x1FFF)); Add(new cMenuEditIntItem( tr("Dpid1"), &data.dpid1, 0, 0x1FFF));

5
vdr.5
View File

@ -8,7 +8,7 @@
.\" License as specified in the file COPYING that comes with the .\" License as specified in the file COPYING that comes with the
.\" vdr distribution. .\" vdr distribution.
.\" .\"
.\" $Id: vdr.5 1.17 2002/12/06 14:21:00 kls Exp $ .\" $Id: vdr.5 1.18 2003/04/26 11:54:35 kls Exp $
.\" .\"
.TH vdr 5 "6 Dec 2002" "1.2.0" "Video Disk Recorder Files" .TH vdr 5 "6 Dec 2002" "1.2.0" "Video Disk Recorder Files"
.SH NAME .SH NAME
@ -105,6 +105,9 @@ The symbol rate of this channel (DVB-S and DVB-C only).
.TP .TP
.B VPID .B VPID
The video PID (set to '0' for radio channels, '1' for encrypted radio channels). The video PID (set to '0' for radio channels, '1' for encrypted radio channels).
If this channel uses a separate PCR PID, it follows the VPID, separated by a
plus sign, as in
.B ...:164+17:...
.TP .TP
.B APID .B APID
The audio PID (either one number, or two, separated by a comma). The audio PID (either one number, or two, separated by a comma).