From c2c45d68c644684e002a92ceee83af7550aaa1e4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 6 Jun 2010 14:49:00 +0200 Subject: =?UTF-8?q?Version=201.7.15=20-=20Added=20Macedonian=20language=20?= =?UTF-8?q?texts=20(thanks=20to=20Dimitar=20Petrovski).=20-=20Updated=20th?= =?UTF-8?q?e=20Estonian=20OSD=20texts=20(thanks=20to=20Arthur=20Konovalov)?= =?UTF-8?q?.=20-=20Updated=20the=20Finnish=20OSD=20texts=20(thanks=20to=20?= =?UTF-8?q?Rolf=20Ahrenberg).=20-=20Added=20handling=20of=20EnhancedAC3Des?= =?UTF-8?q?criptorTag=20(thanks=20to=20Eric=20Valette).=20-=20The=20defaul?= =?UTF-8?q?t=20SVDRP=20port=20is=20now=206419=20(registered=20with=20ICANN?= =?UTF-8?q?/IANA=20by=20Christian=20Tramnitz).=20=20=20Use=20'-p=202001'?= =?UTF-8?q?=20to=20switch=20back=20to=20the=20old=20port=20if=20necessary.?= =?UTF-8?q?=20-=20Updated=20the=20Italian=20OSD=20texts=20(thanks=20to=20D?= =?UTF-8?q?iego=20Pierotto).=20-=20cDvbDevice::ProvidesTransponder()=20now?= =?UTF-8?q?=20checks=20the=20modulation=20capabilities=20of=20the=20=20=20?= =?UTF-8?q?device=20(as=20far=20as=20the=20driver=20allows=20this).=20-=20?= =?UTF-8?q?Fixed=20cFrameDetector::Analyze()=20in=20case=20part=20of=20the?= =?UTF-8?q?=20data=20has=20been=20processed=20and=20=20=20there=20is=20les?= =?UTF-8?q?s=20than=20MIN=5FTS=5FPACKETS=5FFOR=5FFRAME=5FDETECTOR=20left?= =?UTF-8?q?=20(reported=20by=20Derek=20Kelly).=20-=20Added=20a=20note=20ab?= =?UTF-8?q?out=20not=20deleting=20cDeviceHook=20objects=20to=20device.h.?= =?UTF-8?q?=20-=20Added=20user=20defined=20key=20kUser0=20(suggested=20by?= =?UTF-8?q?=20Ulf=20Kiener).=20-=20Include=20paths=20are=20now=20added=20i?= =?UTF-8?q?nstead=20of=20overwriting=20INCLUDES=20in=20the=20Makefile=20(t?= =?UTF-8?q?hanks=20=20=20to=20Paul=20Menzel).=20-=20The=20various=20modula?= =?UTF-8?q?tion=20types=20are=20now=20taken=20into=20account=20when=20sele?= =?UTF-8?q?cting=20a=20device=20for=20=20=20a=20recording=20or=20live=20vi?= =?UTF-8?q?ewing,=20so=20that=20devices=20that=20provide=20more=20capabili?= =?UTF-8?q?ties=20are=20=20=20spared.=20-=20Fixed=20generating=20PMT=20lan?= =?UTF-8?q?guage=20descriptors=20for=20multi=20language=20PIDs=20(thanks?= =?UTF-8?q?=20to=20Rolf=20=20=20Ahrenberg).=20-=20Transponders=20that=20us?= =?UTF-8?q?e=20"8psk=20turbo=20fec"=20(a=20non-standard=20mode=20used=20by?= =?UTF-8?q?=20North=20American=20=20=20providers)=20are=20now=20identified?= =?UTF-8?q?=20by=20assuming=20that=20all=208psk=20transponders=20on=20DVB-?= =?UTF-8?q?S=20use=20=20=20"turbo=20fec".=20In=20order=20to=20determine=20?= =?UTF-8?q?whether=20a=20certain=20device=20can=20handle=20"turbo=20fec",?= =?UTF-8?q?=20=20=20the=20new=20driver=20flag=20FE=5FCAN=5FTURBO=5FFEC=20i?= =?UTF-8?q?s=20checked.=20If=20your=20device=20can=20handle=20"turbo=20=20?= =?UTF-8?q?=20fec",=20and=20your=20driver=20doesn't=20have=20that=20flag,?= =?UTF-8?q?=20yet,=20you=20can=20apply=20the=20patch=20from=20=20=20ftp://?= =?UTF-8?q?ftp.tvdr.de/vdr/Developer/v4l-dvb-add-FE=5FCAN=5FTURBO=5FFEC.di?= =?UTF-8?q?ff.=20A=20temporary=20=20=20macro=20in=20dvbdevice.c=20defines?= =?UTF-8?q?=20the=20flag=20for=20all=20those=20who=20don't=20need=20this?= =?UTF-8?q?=20in=20the=20=20=20driver,=20so=20that=20they=20can=20continue?= =?UTF-8?q?=20using=20an=20unmodified=20driver.=20=20=20Thanks=20to=20Dere?= =?UTF-8?q?k=20Kelly=20for=20testing=20this.=20-=20Updated=20the=20Ukraini?= =?UTF-8?q?an=20OSD=20texts=20(thanks=20to=20Yarema=20Aka=20Knedlyk).=20-?= =?UTF-8?q?=20Fixed=20handling=20"none"=20color=20entries=20in=20XPM=20fil?= =?UTF-8?q?es=20(thanks=20to=20Thomas=20G=C3=BCnther).=20-=20Fixed=20a=20c?= =?UTF-8?q?rash=20when=20creating=20a=20new=20channel=20if=20the=20channel?= =?UTF-8?q?=20list=20is=20empty=20(reported=20=20=20by=20Halim=20Sahin).?= =?UTF-8?q?=20-=20Updated=20the=20Czech=20OSD=20texts=20(thanks=20to=20Rad?= =?UTF-8?q?ek=20Stastny).=20-=20Fixed=20a=20possible=20out=20of=20buffer?= =?UTF-8?q?=20memory=20access=20in=20case=20of=20bad=20TS=20data=20(report?= =?UTF-8?q?ed=20=20=20by=20Rolf=20Ahrenberg).=20-=20Implemented=20handling?= =?UTF-8?q?=20of=20HD=20resolution=20subtitles=20according=20to=20v1.3.1?= =?UTF-8?q?=20of=20=20=20ETSI=20EN=20300=20743,=20chapter=207.2.1=20(thank?= =?UTF-8?q?s=20to=20Rolf=20Ahrenberg).=20-=20The=20EPG=20data=20now=20hand?= =?UTF-8?q?les=20stream=20components=205=20(H.264-video)=20and=206=20(HEAA?= =?UTF-8?q?C-audio).=20-=20Fixed=20a=20problem=20with=20external=20Dolby?= =?UTF-8?q?=20Digital=20processing=20via=20the=20'-a'=20option=20in=20live?= =?UTF-8?q?=20=20=20mode=20and=20with=20TS=20recordings=20(reported=20by?= =?UTF-8?q?=20Christopher=20Reimer).=20-=20Added=20handling=20MPEG=20audio?= =?UTF-8?q?=20types=20"ISO/IEC=2014496-3=20Audio=20with=20LATM=20transport?= =?UTF-8?q?=20syntax"=20=20=20and=20"ISO/IEC=2013818-7=20Audio=20with=20AD?= =?UTF-8?q?TS=20transport=20syntax"=20(suggested=20by=20Luis=20Fernandes).?= =?UTF-8?q?=20=20=20See=20man=20vdr(5)=20on=20how=20the=20APID=20section?= =?UTF-8?q?=20of=20channels=20has=20been=20extended=20to=20store=20=20=20t?= =?UTF-8?q?his=20information.=20-=20Added=20detecting=20channels=20that=20?= =?UTF-8?q?use=20service=20type=200x16.=20-=20Added=20full=20handling=20of?= =?UTF-8?q?=20the=20stream=20types=20of=20Dolby=20Digital=20pids=20=20=20(?= =?UTF-8?q?thanks=20to=20Jose=20Alberto=20Reguero).=20-=20The=20new=20setu?= =?UTF-8?q?p=20option=20"OSD/Number=20keys=20for=20characters"=20can=20be?= =?UTF-8?q?=20used=20to=20control=20whether=20=20=20the=20number=20keys=20?= =?UTF-8?q?can=20be=20used=20to=20enter=20characters=20in=20a=20text=20inp?= =?UTF-8?q?ut=20field=20(suggested=20=20=20by=20Stefan=20Huskamp).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- channels.c | 55 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 14 deletions(-) (limited to 'channels.c') diff --git a/channels.c b/channels.c index a694d54..ebc7eb1 100644 --- a/channels.c +++ b/channels.c @@ -4,13 +4,14 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 2.13 2010/02/21 13:36:04 kls Exp $ + * $Id: channels.c 2.16 2010/06/05 13:33:57 kls Exp $ */ #include "channels.h" #include #include "device.h" #include "epg.h" +#include "libsi/si.h" #include "timers.h" // IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d' @@ -61,6 +62,7 @@ cChannel::cChannel(void) provider = strdup(""); portalName = strdup(""); memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__); + parameters = ""; modification = CHANNELMOD_NONE; schedule = NULL; linkChannels = NULL; @@ -270,14 +272,21 @@ static int IntArraysDiffer(const int *a, const int *b, const char na[][MAXLANGCO return result; } -static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][MAXLANGCODE2] = NULL) +static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[][MAXLANGCODE2] = NULL, const int *t = NULL) { char *q = s; int i = 0; while (a[i] || i == 0) { q += sprintf(q, Base == 16 ? "%s%X" : "%s%d", i ? "," : "", a[i]); - if (a[i] && n && *n[i]) - q += sprintf(q, "=%s", n[i]); + const char *Delim = "="; + if (a[i]) { + if (n && *n[i]) { + q += sprintf(q, "%s%s", Delim, n[i]); + Delim = ""; + } + if (t && t[i]) + q += sprintf(q, "%s@%d", Delim, t[i]); + } if (!a[i]) break; i++; @@ -286,32 +295,32 @@ static int IntArrayToString(char *s, const int *a, int Base = 10, const char n[] return q - s; } -void cChannel::SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][MAXLANGCODE2], int *Dpids, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid) +void cChannel::SetPids(int Vpid, int Ppid, int Vtype, int *Apids, int *Atypes, char ALangs[][MAXLANGCODE2], int *Dpids, int *Dtypes, char DLangs[][MAXLANGCODE2], int *Spids, char SLangs[][MAXLANGCODE2], int Tpid) { int mod = CHANNELMOD_NONE; if (vpid != Vpid || ppid != Ppid || vtype != Vtype || tpid != Tpid) mod |= CHANNELMOD_PIDS; - int m = IntArraysDiffer(apids, Apids, alangs, ALangs) | IntArraysDiffer(dpids, Dpids, dlangs, DLangs) | IntArraysDiffer(spids, Spids, slangs, SLangs); + int m = IntArraysDiffer(apids, Apids, alangs, ALangs) | IntArraysDiffer(atypes, Atypes) | IntArraysDiffer(dpids, Dpids, dlangs, DLangs) | IntArraysDiffer(dtypes, Dtypes) | IntArraysDiffer(spids, Spids, slangs, SLangs); if (m & STRDIFF) mod |= CHANNELMOD_LANGS; if (m & VALDIFF) mod |= CHANNELMOD_PIDS; if (mod) { - const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia + const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2 + 5) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod@type', +10: paranoia char OldApidsBuf[BufferSize]; char NewApidsBuf[BufferSize]; char *q = OldApidsBuf; - q += IntArrayToString(q, apids, 10, alangs); + q += IntArrayToString(q, apids, 10, alangs, atypes); if (dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, dpids, 10, dlangs); + q += IntArrayToString(q, dpids, 10, dlangs, dtypes); } *q = 0; q = NewApidsBuf; - q += IntArrayToString(q, Apids, 10, ALangs); + q += IntArrayToString(q, Apids, 10, ALangs, Atypes); if (Dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, Dpids, 10, DLangs); + q += IntArrayToString(q, Dpids, 10, DLangs, Dtypes); } *q = 0; const int SBufferSize = MAXSPIDS * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod', +10: paranoia @@ -330,11 +339,13 @@ void cChannel::SetPids(int Vpid, int Ppid, int Vtype, int *Apids, char ALangs[][ vtype = Vtype; for (int i = 0; i < MAXAPIDS; i++) { apids[i] = Apids[i]; + atypes[i] = Atypes[i]; strn0cpy(alangs[i], ALangs[i], MAXLANGCODE2); } apids[MAXAPIDS] = 0; for (int i = 0; i < MAXDPIDS; i++) { dpids[i] = Dpids[i]; + dtypes[i] = Dtypes[i]; strn0cpy(dlangs[i], DLangs[i], MAXLANGCODE2); } dpids[MAXDPIDS] = 0; @@ -484,13 +495,13 @@ cString cChannel::ToText(const cChannel *Channel) if (Channel->vpid && Channel->vtype) q += snprintf(q, sizeof(vpidbuf) - (q - vpidbuf), "=%d", Channel->vtype); *q = 0; - const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod', +10: paranoia + const int BufferSize = (MAXAPIDS + MAXDPIDS) * (5 + 1 + MAXLANGCODE2 + 5) + 10; // 5 digits plus delimiting ',' or ';' plus optional '=cod+cod@type', +10: paranoia char apidbuf[BufferSize]; q = apidbuf; - q += IntArrayToString(q, Channel->apids, 10, Channel->alangs); + q += IntArrayToString(q, Channel->apids, 10, Channel->alangs, Channel->atypes); if (Channel->dpids[0]) { *q++ = ';'; - q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs); + q += IntArrayToString(q, Channel->dpids, 10, Channel->dlangs, Channel->dtypes); } *q = 0; char caidbuf[MAXCAIDS * 5 + 10]; // 5: 4 digits plus delimiting ',', 10: paranoia @@ -546,7 +557,9 @@ bool cChannel::Parse(const char *s) vpid = ppid = 0; vtype = 0; apids[0] = 0; + atypes[0] = 0; dpids[0] = 0; + dtypes[0] = 0; ok = false; if (parambuf && sourcebuf && vpidbuf && apidbuf) { parameters = parambuf; @@ -579,9 +592,15 @@ bool cChannel::Parse(const char *s) char *strtok_next; while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumApids < MAXAPIDS) { + atypes[NumApids] = 4; // backwards compatibility char *l = strchr(q, '='); if (l) { *l++ = 0; + char *t = strchr(l, '@'); + if (t) { + *t++ = 0; + atypes[NumApids] = strtol(t, NULL, 10); + } strn0cpy(alangs[NumApids], l, MAXLANGCODE2); } else @@ -593,6 +612,7 @@ bool cChannel::Parse(const char *s) p = NULL; } apids[NumApids] = 0; + atypes[NumApids] = 0; if (dpidbuf) { char *p = dpidbuf; char *q; @@ -600,9 +620,15 @@ bool cChannel::Parse(const char *s) char *strtok_next; while ((q = strtok_r(p, ",", &strtok_next)) != NULL) { if (NumDpids < MAXDPIDS) { + dtypes[NumDpids] = SI::AC3DescriptorTag; // backwards compatibility char *l = strchr(q, '='); if (l) { *l++ = 0; + char *t = strchr(l, '@'); + if (t) { + *t++ = 0; + dtypes[NumDpids] = strtol(t, NULL, 10); + } strn0cpy(dlangs[NumDpids], l, MAXLANGCODE2); } else @@ -614,6 +640,7 @@ bool cChannel::Parse(const char *s) p = NULL; } dpids[NumDpids] = 0; + dtypes[NumDpids] = 0; } if (caidbuf) { -- cgit v1.2.3