summaryrefslogtreecommitdiff
path: root/pat.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-11-01 15:47:59 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2010-11-01 15:47:59 +0100
commitcfb37a7edf8caafb0f07594b080837231ba9c575 (patch)
treed92e4c39377e735feec619205d1642730ac0ff62 /pat.c
parent4f50c34824f0c717dd52e0ce32497b7f421c1c66 (diff)
downloadvdr-cfb37a7edf8caafb0f07594b080837231ba9c575.tar.gz
vdr-cfb37a7edf8caafb0f07594b080837231ba9c575.tar.bz2
Added support for "registration descriptor"
Diffstat (limited to 'pat.c')
-rw-r--r--pat.c73
1 files changed, 58 insertions, 15 deletions
diff --git a/pat.c b/pat.c
index 736ddc21..7d6cfa92 100644
--- a/pat.c
+++ b/pat.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: pat.c 2.13 2010/06/13 11:12:12 kls Exp $
+ * $Id: pat.c 2.14 2010/11/01 15:34:28 kls Exp $
*/
#include "pat.h"
@@ -456,21 +456,63 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
}
}
break;
+ case 0x80: // STREAMTYPE_USER_PRIVATE
+ {
+ SI::Descriptor *d;
+ for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
+ switch (d->getDescriptorTag()) {
+ case SI::RegistrationDescriptorTag: {
+ SI::RegistrationDescriptor *rd = (SI::RegistrationDescriptor *)d;
+ // http://www.smpte-ra.org/mpegreg/mpegreg.html
+ switch (rd->getFormatIdentifier()) {
+ case 0x44434949: // 'DCII' DigiChipher II
+ Vpid = esPid;
+ Ppid = pmt.getPCRPid();
+ Vtype = stream.getStreamType();
+ ProcessCaDescriptors = true;
+ break;
+ default:
+ //printf("Format identifier: 0x08X\n", rd->getFormatIdentifier());
+ break;
+ }
+ }
+ break;
+ default: ;
+ }
+ delete d;
+ }
+ }
+ break;
case 0x81: // STREAMTYPE_USER_PRIVATE
- if (Channel->IsAtsc()) { // ATSC AC-3
- char lang[MAXLANGCODE1] = { 0 };
- SI::Descriptor *d;
- for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
- switch (d->getDescriptorTag()) {
- case SI::ISO639LanguageDescriptorTag: {
- SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d;
- strn0cpy(lang, I18nNormalizeLanguageCode(ld->languageCode), MAXLANGCODE1);
- }
- break;
- default: ;
- }
- delete d;
- }
+ {
+ char lang[MAXLANGCODE1] = { 0 };
+ bool IsAc3 = false;
+ SI::Descriptor *d;
+ for (SI::Loop::Iterator it; (d = stream.streamDescriptors.getNext(it)); ) {
+ switch (d->getDescriptorTag()) {
+ case SI::RegistrationDescriptorTag: {
+ SI::RegistrationDescriptor *rd = (SI::RegistrationDescriptor *)d;
+ // http://www.smpte-ra.org/mpegreg/mpegreg.html
+ switch (rd->getFormatIdentifier()) {
+ case 0x41432D33: // 'AC-3'
+ IsAc3 = true;
+ break;
+ default:
+ //printf("Format identifier: 0x08X\n", rd->getFormatIdentifier());
+ break;
+ }
+ }
+ break;
+ case SI::ISO639LanguageDescriptorTag: {
+ SI::ISO639LanguageDescriptor *ld = (SI::ISO639LanguageDescriptor *)d;
+ strn0cpy(lang, I18nNormalizeLanguageCode(ld->languageCode), MAXLANGCODE1);
+ }
+ break;
+ default: ;
+ }
+ delete d;
+ }
+ if (IsAc3) {
if (NumDpids < MAXDPIDS) {
Dpids[NumDpids] = esPid;
Dtypes[NumDpids] = SI::AC3DescriptorTag;
@@ -479,6 +521,7 @@ void cPatFilter::Process(u_short Pid, u_char Tid, const u_char *Data, int Length
}
ProcessCaDescriptors = true;
}
+ }
break;
default: ;//printf("PID: %5d %5d %2d %3d %3d\n", pmt.getServiceId(), stream.getPid(), stream.getStreamType(), pmt.getVersionNumber(), Channel->Number());
}