diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d0307712..64edccc1 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1194,6 +1194,7 @@ Rolf Ahrenberg for fixing a problem with subtitles not being displayed because the broadcaster doesn't set the data's version numbers as required by the DVB standard for the "binary skip" patch + for adding support for LCN (Logical Channel Numbers) Ralf Klueber for reporting a bug in cutting a recording if there is only a single editing mark diff --git a/HISTORY b/HISTORY index 251107cf..2e8be678 100644 --- a/HISTORY +++ b/HISTORY @@ -8450,3 +8450,5 @@ Video Disk Recorder Revision History - Made cRecording::GetResume() public (suggested by Stefan Braun). - Fixed setting the read index in cDvbPlayer::Goto() in case Still is false. - The function cDvbPlayer::Goto() now automatically calls Play() if Still is false. +- Added support for LCN (Logical Channel Numbers), which plugins may use to sort + channels (thanks to Rolf Ahrenberg). diff --git a/channels.c b/channels.c index b91df6dc..564088f4 100644 --- a/channels.c +++ b/channels.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.c 3.7 2015/01/14 12:15:03 kls Exp $ + * $Id: channels.c 3.8 2015/02/01 13:47:05 kls Exp $ */ #include "channels.h" @@ -248,6 +248,15 @@ void cChannel::SetId(int Nid, int Tid, int Sid, int Rid) } } +void cChannel::SetLcn(int Lcn) +{ + if (lcn != Lcn) { + if (Number()) + dsyslog("changing lcn of channel %d (%s) from %d to %d\n", Number(), name, lcn, Lcn); + lcn = Lcn; + } +} + void cChannel::SetName(const char *Name, const char *ShortName, const char *Provider) { if (!isempty(Name)) { diff --git a/channels.h b/channels.h index 7ca1e3e5..33238821 100644 --- a/channels.h +++ b/channels.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: channels.h 3.2 2014/01/04 15:01:21 kls Exp $ + * $Id: channels.h 3.3 2015/02/01 13:30:26 kls Exp $ */ #ifndef __CHANNELS_H @@ -121,6 +121,7 @@ private: int tid; int sid; int rid; + int lcn; // Logical channel number assigned by data stream (or -1 if not available) int number; // Sequence number assigned on load bool groupSep; int __EndData__; @@ -174,6 +175,7 @@ public: int Tid(void) const { return tid; } int Sid(void) const { return sid; } int Rid(void) const { return rid; } + int Lcn(void) const { return lcn; } int Number(void) const { return number; } void SetNumber(int Number) { number = Number; } bool GroupSep(void) const { return groupSep; } @@ -192,6 +194,7 @@ public: void CopyTransponderData(const cChannel *Channel); bool SetTransponderData(int Source, int Frequency, int Srate, const char *Parameters, bool Quiet = false); void SetId(int Nid, int Tid, int Sid, int Rid = 0); + void SetLcn(int Lcn); void SetName(const char *Name, const char *ShortName, const char *Provider); void SetPortalName(const char *PortalName); void 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); diff --git a/nit.c b/nit.c index f3fe9231..d9ec1f8f 100644 --- a/nit.c +++ b/nit.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: nit.c 3.3 2014/03/16 10:38:31 kls Exp $ + * $Id: nit.c 3.4 2015/02/01 13:46:00 kls Exp $ */ #include "nit.h" @@ -357,6 +357,40 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length } } break; + case SI::LogicalChannelDescriptorTag: { + SI::LogicalChannelDescriptor *lcd = (SI::LogicalChannelDescriptor *)d; + SI::LogicalChannelDescriptor::LogicalChannel LogicalChannel; + for (SI::Loop::Iterator it4; lcd->logicalChannelLoop.getNext(LogicalChannel, it4); ) { + int lcn = LogicalChannel.getLogicalChannelNumber(); + int sid = LogicalChannel.getServiceId(); + if (LogicalChannel.getVisibleServiceFlag()) { + for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { + if (!Channel->GroupSep() && Channel->Sid() == sid && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) { + Channel->SetLcn(lcn); + break; + } + } + } + } + } + break; + case SI::HdSimulcastLogicalChannelDescriptorTag: { + SI::HdSimulcastLogicalChannelDescriptor *lcd = (SI::HdSimulcastLogicalChannelDescriptor *)d; + SI::HdSimulcastLogicalChannelDescriptor::HdSimulcastLogicalChannel HdSimulcastLogicalChannel; + for (SI::Loop::Iterator it4; lcd->hdSimulcastLogicalChannelLoop.getNext(HdSimulcastLogicalChannel, it4); ) { + int lcn = HdSimulcastLogicalChannel.getLogicalChannelNumber(); + int sid = HdSimulcastLogicalChannel.getServiceId(); + if (HdSimulcastLogicalChannel.getVisibleServiceFlag()) { + for (cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) { + if (!Channel->GroupSep() && Channel->Sid() == sid && Channel->Nid() == ts.getOriginalNetworkId() && Channel->Tid() == ts.getTransportStreamId()) { + Channel->SetLcn(lcn); + break; + } + } + } + } + } + break; default: ; } delete d;