mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The SDT is now only parsed *after* the NIT has been read
This commit is contained in:
parent
da404e00c0
commit
ba9651e863
5
HISTORY
5
HISTORY
@ -7870,7 +7870,7 @@ Video Disk Recorder Revision History
|
|||||||
and also to use the correct directory with --edit (the latter reported by Marko
|
and also to use the correct directory with --edit (the latter reported by Marko
|
||||||
Mäkelä).
|
Mäkelä).
|
||||||
|
|
||||||
2014-03-10: Version 2.0.6
|
2014-03-11: Version 2.0.6
|
||||||
|
|
||||||
- Updated 'sources.conf' (thanks to Antti Hartikainen).
|
- Updated 'sources.conf' (thanks to Antti Hartikainen).
|
||||||
- cFont::CreateFont() now returns a dummy font in case there are no fonts installed.
|
- cFont::CreateFont() now returns a dummy font in case there are no fonts installed.
|
||||||
@ -7907,3 +7907,6 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed adding new source types in case they are already registered (reported by Rolf
|
- Fixed adding new source types in case they are already registered (reported by Rolf
|
||||||
Ahrenberg).
|
Ahrenberg).
|
||||||
- Fixed drawing the live indicator in the LCARS skin in case there are no devices.
|
- Fixed drawing the live indicator in the LCARS skin in case there are no devices.
|
||||||
|
- The SDT is now only parsed *after* the NIT has been read, and it explicitly uses
|
||||||
|
the source value derived from the NIT. This should prevent new channels from being
|
||||||
|
created with the wrong source.
|
||||||
|
4
device.c
4
device.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.c 2.74.1.3 2014/02/18 14:12:08 kls Exp $
|
* $Id: device.c 2.74.1.4 2014/03/11 09:29:52 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@ -574,7 +574,7 @@ void cDevice::StartSectionHandler(void)
|
|||||||
AttachFilter(eitFilter = new cEitFilter);
|
AttachFilter(eitFilter = new cEitFilter);
|
||||||
AttachFilter(patFilter = new cPatFilter);
|
AttachFilter(patFilter = new cPatFilter);
|
||||||
AttachFilter(sdtFilter = new cSdtFilter(patFilter));
|
AttachFilter(sdtFilter = new cSdtFilter(patFilter));
|
||||||
AttachFilter(nitFilter = new cNitFilter);
|
AttachFilter(nitFilter = new cNitFilter(sdtFilter));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
nit.c
8
nit.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: nit.c 2.10 2013/03/07 09:42:29 kls Exp $
|
* $Id: nit.c 2.10.1.1 2014/03/11 09:29:59 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nit.h"
|
#include "nit.h"
|
||||||
@ -19,8 +19,9 @@
|
|||||||
#define DVB_SYSTEM_1 0 // see also dvbdevice.c
|
#define DVB_SYSTEM_1 0 // see also dvbdevice.c
|
||||||
#define DVB_SYSTEM_2 1
|
#define DVB_SYSTEM_2 1
|
||||||
|
|
||||||
cNitFilter::cNitFilter(void)
|
cNitFilter::cNitFilter(cSdtFilter *SdtFilter)
|
||||||
{
|
{
|
||||||
|
sdtFilter = SdtFilter;
|
||||||
numNits = 0;
|
numNits = 0;
|
||||||
networkId = 0;
|
networkId = 0;
|
||||||
Set(0x10, 0x40); // NIT
|
Set(0x10, 0x40); // NIT
|
||||||
@ -183,6 +184,7 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sdtFilter->Trigger(Source);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SI::S2SatelliteDeliverySystemDescriptorTag: {
|
case SI::S2SatelliteDeliverySystemDescriptorTag: {
|
||||||
@ -253,6 +255,7 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sdtFilter->Trigger(Source);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SI::TerrestrialDeliverySystemDescriptorTag: {
|
case SI::TerrestrialDeliverySystemDescriptorTag: {
|
||||||
@ -316,6 +319,7 @@ void cNitFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sdtFilter->Trigger(Source);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SI::ExtensionDescriptorTag: {
|
case SI::ExtensionDescriptorTag: {
|
||||||
|
6
nit.h
6
nit.h
@ -4,13 +4,14 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: nit.h 1.3 2007/06/10 08:50:21 kls Exp $
|
* $Id: nit.h 2.0.1.1 2014/03/11 09:30:05 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __NIT_H
|
#ifndef __NIT_H
|
||||||
#define __NIT_H
|
#define __NIT_H
|
||||||
|
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
|
#include "sdt.h"
|
||||||
|
|
||||||
#define MAXNITS 16
|
#define MAXNITS 16
|
||||||
#define MAXNETWORKNAME Utf8BufSize(256)
|
#define MAXNETWORKNAME Utf8BufSize(256)
|
||||||
@ -26,13 +27,14 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
cSectionSyncer sectionSyncer;
|
cSectionSyncer sectionSyncer;
|
||||||
|
cSdtFilter *sdtFilter;
|
||||||
cNit nits[MAXNITS];
|
cNit nits[MAXNITS];
|
||||||
u_short networkId;
|
u_short networkId;
|
||||||
int numNits;
|
int numNits;
|
||||||
protected:
|
protected:
|
||||||
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
||||||
public:
|
public:
|
||||||
cNitFilter(void);
|
cNitFilter(cSdtFilter *SdtFilter);
|
||||||
virtual void SetStatus(bool On);
|
virtual void SetStatus(bool On);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
23
sdt.c
23
sdt.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "sdt.h"
|
||||||
@ -17,19 +17,30 @@
|
|||||||
|
|
||||||
cSdtFilter::cSdtFilter(cPatFilter *PatFilter)
|
cSdtFilter::cSdtFilter(cPatFilter *PatFilter)
|
||||||
{
|
{
|
||||||
|
source = cSource::stNone;
|
||||||
patFilter = PatFilter;
|
patFilter = PatFilter;
|
||||||
Set(0x11, 0x42); // SDT
|
Set(0x11, 0x42); // SDT
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSdtFilter::SetStatus(bool On)
|
void cSdtFilter::SetStatus(bool On)
|
||||||
{
|
{
|
||||||
|
cMutexLock MutexLock(&mutex);
|
||||||
cFilter::SetStatus(On);
|
cFilter::SetStatus(On);
|
||||||
sectionSyncer.Reset();
|
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)
|
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;
|
return;
|
||||||
SI::SDT sdt(Data, false);
|
SI::SDT sdt(Data, false);
|
||||||
if (!sdt.CheckCRCAndParse())
|
if (!sdt.CheckCRCAndParse())
|
||||||
@ -40,9 +51,9 @@ void cSdtFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
|
|||||||
return;
|
return;
|
||||||
SI::SDT::Service SiSdtService;
|
SI::SDT::Service SiSdtService;
|
||||||
for (SI::Loop::Iterator it; sdt.serviceLoop.getNext(SiSdtService, it); ) {
|
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)
|
if (!channel)
|
||||||
channel = Channels.GetByChannelID(tChannelID(Source(), 0, Transponder(), SiSdtService.getServiceId()));
|
channel = Channels.GetByChannelID(tChannelID(source, 0, Transponder(), SiSdtService.getServiceId()));
|
||||||
|
|
||||||
cLinkChannels *LinkChannels = NULL;
|
cLinkChannels *LinkChannels = NULL;
|
||||||
SI::Descriptor *d;
|
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));
|
sd->serviceName.getText(NameBuf, ShortNameBuf, sizeof(NameBuf), sizeof(ShortNameBuf));
|
||||||
char *pn = compactspace(NameBuf);
|
char *pn = compactspace(NameBuf);
|
||||||
char *ps = compactspace(ShortNameBuf);
|
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
|
// Some cable providers don't mark short channel names according to the
|
||||||
// standard, but rather go their own way and use "name>short name":
|
// standard, but rather go their own way and use "name>short name":
|
||||||
char *p = strchr(pn, '>'); // fix for UPC Wien
|
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 *nrd = (SI::NVODReferenceDescriptor *)d;
|
||||||
SI::NVODReferenceDescriptor::Service Service;
|
SI::NVODReferenceDescriptor::Service Service;
|
||||||
for (SI::Loop::Iterator it; nrd->serviceLoop.getNext(Service, it); ) {
|
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) {
|
if (!link && Setup.UpdateChannels >= 4) {
|
||||||
link = Channels.NewChannel(Channel(), "NVOD", "", "", Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId());
|
link = Channels.NewChannel(Channel(), "NVOD", "", "", Service.getOriginalNetworkId(), Service.getTransportStream(), Service.getServiceId());
|
||||||
patFilter->Trigger(Service.getServiceId());
|
patFilter->Trigger(Service.getServiceId());
|
||||||
|
5
sdt.h
5
sdt.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: sdt.h 1.2 2004/01/05 14:30:14 kls Exp $
|
* $Id: sdt.h 2.0.1.1 2014/03/11 09:31:08 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SDT_H
|
#ifndef __SDT_H
|
||||||
@ -15,13 +15,16 @@
|
|||||||
|
|
||||||
class cSdtFilter : public cFilter {
|
class cSdtFilter : public cFilter {
|
||||||
private:
|
private:
|
||||||
|
cMutex mutex;
|
||||||
cSectionSyncer sectionSyncer;
|
cSectionSyncer sectionSyncer;
|
||||||
|
int source;
|
||||||
cPatFilter *patFilter;
|
cPatFilter *patFilter;
|
||||||
protected:
|
protected:
|
||||||
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length);
|
||||||
public:
|
public:
|
||||||
cSdtFilter(cPatFilter *PatFilter);
|
cSdtFilter(cPatFilter *PatFilter);
|
||||||
virtual void SetStatus(bool On);
|
virtual void SetStatus(bool On);
|
||||||
|
void Trigger(int Source);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__SDT_H
|
#endif //__SDT_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user