summaryrefslogtreecommitdiff
path: root/sdt.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-01-11 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2004-01-11 18:00:00 +0100
commita76a03c0d815680e3e8fc52f24f60a30177d3021 (patch)
tree50c39ea8e54d1d4242f10ab636e8500505201e5b /sdt.c
parent93a94b18b540fbcb9bcdaaea9abd26cdf23d6ee6 (diff)
downloadvdr-patch-lnbsharing-a76a03c0d815680e3e8fc52f24f60a30177d3021.tar.gz
vdr-patch-lnbsharing-a76a03c0d815680e3e8fc52f24f60a30177d3021.tar.bz2
Version 1.3.1vdr-1.3.1
- Fixed a lockup in the EPG scanner when no non-primary device was available (thanks to Martin Holst for reporting this one). - Fixed a compiler warning about virtual cConfig::Load() functions (thanks to Lauri Tischler for reporting this one). - Fixed a warning about character comparison in libsi/si.c (thanks to Lauri Tischler for reporting this one). - The new parameter "Update channels" in the "Setup/DVB" menu can be used to control if and how channels will be automatically updated (see MANUAL). This has already been part of the 'autopid' patch by Andreas Schultz and has now been adopted. - Fixed a crash in case there is no DVB hardware present (thanks to Sascha Volkenandt for reporting this one). - Changed calculation of channel ids to make it work for tv stations that use the undefined NID value 0 (thanks to Teemu Rantanen for reporting this one). - Enhanced the SDT filter to handle multi part sections. - Added support for selecting preferred EPG languages (based upon a patch by Teemu Rantanen). - Fixed a 'const' in libsi/si.h (thanks to Marcel Wiesweg). - Fixed the 'su' call in 'runvdr' to make it work on systems that require the user name to appear before the command option (thanks to Robert Huitl). - Fixed testing for matching section filters in case they are turned off (thanks to Marcel Wiesweg). - In case of incomplete sections an error message is now logged only every 10 seconds. - Fixed a possible NULL pointer access in cEITScanner::Process() (thanks to Andreas Kool). - The actual transponder data is now taken from the NIT and existing channels are adjusted if necessary. If the NIT contains new transponders, they are scanned for channels during the next EPG scan. Note that only the satellite branches are tested, cable and terrestrial need to be tested by somebody who actually has such equipment.
Diffstat (limited to 'sdt.c')
-rw-r--r--sdt.c86
1 files changed, 35 insertions, 51 deletions
diff --git a/sdt.c b/sdt.c
index a4e91b8..9d760bf 100644
--- a/sdt.c
+++ b/sdt.c
@@ -4,42 +4,47 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sdt.c 1.1 2004/01/04 11:54:42 kls Exp $
+ * $Id: sdt.c 1.4 2004/01/11 14:28:28 kls Exp $
*/
#include "sdt.h"
#include "channels.h"
+#include "config.h"
#include "libsi/section.h"
#include "libsi/descriptor.h"
-// --- cSDT ------------------------------------------------------------------
+// --- cSdtFilter ------------------------------------------------------------
-class cSDT : public SI::SDT {
-public:
- cSDT(int Source, int Transponder, uchar &lastSdtVersion, cPatFilter *PatFilter, const u_char *Data);
- };
+cSdtFilter::cSdtFilter(cPatFilter *PatFilter)
+{
+ patFilter = PatFilter;
+ Set(0x11, 0x42); // SDT
+}
-cSDT::cSDT(int Source, int Transponder, uchar &lastSdtVersion, cPatFilter *PatFilter, const u_char *Data)
-:SI::SDT(Data, false)
+void cSdtFilter::SetStatus(bool On)
{
- if (!CheckCRCAndParse())
- return;
+ cFilter::SetStatus(On);
+ sectionSyncer.Reset();
+}
- if (getVersionNumber() == lastSdtVersion)
+void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
+{
+ if (!(Source() && Transponder()))
+ return;
+ SI::SDT sdt(Data, false);
+ if (!sdt.CheckCRCAndParse())
+ return;
+ if (!sectionSyncer.Sync(sdt.getVersionNumber(), sdt.getSectionNumber(), sdt.getLastSectionNumber()))
return;
-
if (!Channels.Lock(true, 10))
return;
-
- lastSdtVersion = getVersionNumber();
-
SI::SDT::Service SiSdtService;
- for (SI::Loop::Iterator it; serviceLoop.hasNext(it); ) {
- SiSdtService = serviceLoop.getNext(it);
+ for (SI::Loop::Iterator it; sdt.serviceLoop.hasNext(it); ) {
+ SiSdtService = sdt.serviceLoop.getNext(it);
- cChannel *Channel = Channels.GetByChannelID(tChannelID(Source, getOriginalNetworkId(), getTransportStreamId(), SiSdtService.getServiceId()));
- if (!Channel)
- Channel = Channels.GetByChannelID(tChannelID(Source, 0, Transponder, SiSdtService.getServiceId()));
+ cChannel *channel = Channels.GetByChannelID(tChannelID(Source(), sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId()));
+ if (!channel)
+ channel = Channels.GetByChannelID(tChannelID(Source(), 0, Transponder(), SiSdtService.getServiceId()));
SI::Descriptor *d;
for (SI::Loop::Iterator it2; (d = SiSdtService.serviceDescriptors.getNext(it2)); ) {
@@ -78,18 +83,19 @@ cSDT::cSDT(int Source, int Transponder, uchar &lastSdtVersion, cPatFilter *PatFi
strcpy(ps, NameBuf);
pn = ShortNameBuf;
}
- if (Channel) {
- Channel->SetId(getOriginalNetworkId(), getTransportStreamId(), SiSdtService.getServiceId());
- Channel->SetName(pn);
+ if (channel) {
+ channel->SetId(sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId());
+ if (Setup.UpdateChannels >= 1)
+ channel->SetName(pn);
// Using SiSdtService.getFreeCaMode() is no good, because some
// tv stations set this flag even for non-encrypted channels :-(
// The special value 0xFFFF was supposed to mean "unknown encryption"
// and would have been overwritten with real CA values later:
- // Channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0);
+ // channel->SetCa(SiSdtService.getFreeCaMode() ? 0xFFFF : 0);
}
- else if (*pn) {
- Channel = Channels.NewChannel(Source, Transponder, pn, getOriginalNetworkId(), getTransportStreamId(), SiSdtService.getServiceId());
- PatFilter->Trigger();
+ else if (*pn && Setup.UpdateChannels >= 3) {
+ channel = Channels.NewChannel(Channel(), pn, sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), SiSdtService.getServiceId());
+ patFilter->Trigger();
}
}
}
@@ -100,9 +106,9 @@ cSDT::cSDT(int Source, int Transponder, uchar &lastSdtVersion, cPatFilter *PatFi
/*
case SI::CaIdentifierDescriptorTag: {
SI::CaIdentifierDescriptor *cid = (SI::CaIdentifierDescriptor *)d;
- if (Channel) {
+ if (channel) {
for (SI::Loop::Iterator it; cid->identifiers.hasNext(it); )
- Channel->SetCa(cid->identifiers.getNext(it));
+ channel->SetCa(cid->identifiers.getNext(it));
}
}
break;
@@ -122,25 +128,3 @@ cSDT::cSDT(int Source, int Transponder, uchar &lastSdtVersion, cPatFilter *PatFi
}
Channels.Unlock();
}
-
-
-// --- cSdtFilter ------------------------------------------------------------
-
-cSdtFilter::cSdtFilter(cPatFilter *PatFilter)
-{
- lastSdtVersion = 0xFF;
- patFilter = PatFilter;
- Set(0x11, 0x42); // SDT
-}
-
-void cSdtFilter::SetStatus(bool On)
-{
- cFilter::SetStatus(On);
- lastSdtVersion = 0xFF;
-}
-
-void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
-{
- if (Source() && Transponder())
- cSDT SDT(Source(), Transponder(), lastSdtVersion, patFilter, Data);
-}