From d303632efed839aa7bd7a8a743da08a75665020d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 3 Feb 2001 16:28:03 +0100 Subject: Implemented TT PID --- config.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 5838c68c..d4d3daf0 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.39 2001/01/14 15:29:15 kls Exp $ + * $Id: config.c 1.40 2001/02/03 16:19:42 kls Exp $ */ #include "config.h" @@ -199,6 +199,7 @@ cChannel::cChannel(const cChannel *Channel) srate = Channel ? Channel->srate : 27500; vpid = Channel ? Channel->vpid : 255; apid = Channel ? Channel->apid : 256; + tpid = Channel ? Channel->tpid : 32; ca = Channel ? Channel->ca : 0; pnr = Channel ? Channel->pnr : 0; groupSep = Channel ? Channel->groupSep : false; @@ -216,7 +217,7 @@ const char *cChannel::ToText(cChannel *Channel) if (Channel->groupSep) asprintf(&buffer, ":%s\n", s); else - asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, Channel->apid, Channel->ca, Channel->pnr); + asprintf(&buffer, "%s:%d:%c:%d:%d:%d:%d:%d:%d:%d\n", s, Channel->frequency, Channel->polarization, Channel->diseqc, Channel->srate, Channel->vpid, Channel->apid, Channel->tpid, Channel->ca, Channel->pnr); return buffer; } @@ -239,8 +240,15 @@ bool cChannel::Parse(const char *s) } else { groupSep = false; - int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apid, &ca, &pnr); - if (fields == 9) { + //XXX + int fields = sscanf(s, "%a[^:]:%d:%c:%d:%d:%d:%d:%d:%d:%d", &buffer, &frequency, &polarization, &diseqc, &srate, &vpid, &apid, &tpid, &ca, &pnr); + if (fields >= 9) { + if (fields == 9) { + // allow reading of old format + pnr = ca; + ca = tpid; + tpid = 0; + } strn0cpy(name, buffer, MaxChannelName); delete buffer; } @@ -265,7 +273,7 @@ bool cChannel::Switch(cDvbApi *DvbApi, bool Log) isyslog(LOG_INFO, "switching to channel %d", number); } for (int i = 3; i--;) { - if (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid, ca, pnr)) + if (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid, tpid, ca, pnr)) return true; esyslog(LOG_ERR, "retrying"); } -- cgit v1.2.3