summaryrefslogtreecommitdiff
path: root/sdt.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2014-03-11 09:32:48 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2014-03-11 09:32:48 +0100
commitba9651e86348d56f3b7e937652f78fc0fe9e86fa (patch)
treed1d2ff808c9155ebac6545e9499367cebdfdc4ea /sdt.c
parentda404e00c0c95978bd2b126b6e2a6b01556630ec (diff)
downloadvdr-ba9651e86348d56f3b7e937652f78fc0fe9e86fa.tar.gz
vdr-ba9651e86348d56f3b7e937652f78fc0fe9e86fa.tar.bz2
The SDT is now only parsed *after* the NIT has been read
Diffstat (limited to 'sdt.c')
-rw-r--r--sdt.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sdt.c b/sdt.c
index 8eeebc40..18efcbc2 100644
--- a/sdt.c
+++ b/sdt.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: sdt.c 2.5.1.1 2014/02/18 14:12:33 kls Exp $
+ * $Id: sdt.c 2.5.1.2 2014/03/11 09:30:59 kls Exp $
*/
#include "sdt.h"
@@ -17,19 +17,30 @@
cSdtFilter::cSdtFilter(cPatFilter *PatFilter)
{
+ source = cSource::stNone;
patFilter = PatFilter;
Set(0x11, 0x42); // SDT
}
void cSdtFilter::SetStatus(bool On)
{
+ cMutexLock MutexLock(&mutex);
cFilter::SetStatus(On);
sectionSyncer.Reset();
+ if (!On)
+ source = cSource::stNone;
+}
+
+void cSdtFilter::Trigger(int Source)
+{
+ cMutexLock MutexLock(&mutex);
+ source = Source;
}
void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
{
- if (!(Source() && Transponder()))
+ cMutexLock MutexLock(&mutex);
+ if (!(source && Transponder()))
return;
SI::SDT sdt(Data, false);
if (!sdt.CheckCRCAndParse())
@@ -40,9 +51,9 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
return;
SI::SDT::Service SiSdtService;
for (SI::Loop::Iterator it; sdt.serviceLoop.getNext(SiSdtService, it); ) {
- cChannel *channel = Channels.GetByChannelID(tChannelID(Source(), sdt.getOriginalNetworkId(), sdt.getTransportStreamId(), 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()));
+ channel = Channels.GetByChannelID(tChannelID(source, 0, Transponder(), SiSdtService.getServiceId()));
cLinkChannels *LinkChannels = NULL;
SI::Descriptor *d;
@@ -64,7 +75,7 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
sd->serviceName.getText(NameBuf, ShortNameBuf, sizeof(NameBuf), sizeof(ShortNameBuf));
char *pn = compactspace(NameBuf);
char *ps = compactspace(ShortNameBuf);
- if (!*ps && cSource::IsCable(Source())) {
+ if (!*ps && cSource::IsCable(source)) {
// Some cable providers don't mark short channel names according to the
// standard, but rather go their own way and use "name>short name":
char *p = strchr(pn, '>'); // fix for UPC Wien
@@ -115,7 +126,7 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
SI::NVODReferenceDescriptor *nrd = (SI::NVODReferenceDescriptor *)d;
SI::NVODReferenceDescriptor::Service Service;
for (SI::Loop::Iterator it; nrd->serviceLoop.getNext(Service, it); ) {
- cChannel *link = Channels.GetByChannelID(tChannelID(Source(), Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId()));
+ cChannel *link = Channels.GetByChannelID(tChannelID(source, Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId()));
if (!link && Setup.UpdateChannels >= 4) {
link = Channels.NewChannel(Channel(), "NVOD", "", "", Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId());
patFilter->Trigger(Service.getServiceId());