summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--markad-standalone.cpp35
-rw-r--r--markad-standalone.h10
-rw-r--r--recv.cpp8
3 files changed, 39 insertions, 14 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 902ca1c..e6d1b20 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -287,9 +287,16 @@ void cMarkAdStandalone::CheckPATPMT(const char *Directory)
int i=205+desc_len;
+
while (i<section_end)
{
+ struct ES_DESCRIPTOR *es=NULL;
struct STREAMINFO *si = (struct STREAMINFO *) &patpmt[i];
+ int esinfo_len=(si->ES_info_length_H<<8)+si->ES_info_length_L;
+ if (esinfo_len)
+ {
+ es = (struct ES_DESCRIPTOR *) &patpmt[i+sizeof(struct STREAMINFO)];
+ }
// oh no -> more checks!
if (si->reserved1!=7) return;
@@ -302,26 +309,35 @@ void cMarkAdStandalone::CheckPATPMT(const char *Directory)
case 0x1:
case 0x2:
macontext.General.VPid.Type=MARKAD_PIDTYPE_VIDEO_H262;
- macontext.General.VPid.Num=pid;
+ // just use the first pid
+ if (!macontext.General.VPid.Num) macontext.General.VPid.Num=pid;
break;
case 0x3:
case 0x4:
- macontext.General.APid.Num=pid;
+ // just use the first pid
+ if (!macontext.General.APid.Num) macontext.General.APid.Num=pid;
+ break;
case 0x6:
- macontext.General.DPid.Num=pid;
+ if (es)
+ {
+ if (es->Descriptor_Tag==0x6A) macontext.General.DPid.Num=pid;
+ }
+ else
+ {
+ macontext.General.DPid.Num=pid;
+ }
break;
case 0x1b:
macontext.General.VPid.Type=MARKAD_PIDTYPE_VIDEO_H264;
- macontext.General.VPid.Num=pid;
macontext.General.H264=true;
+ // just use the first pid
+ if (!macontext.General.VPid.Num) macontext.General.VPid.Num=pid;
break;
}
- int esinfo_len=(si->ES_info_length_H<<8)+si->ES_info_length_L;
-
i+=(sizeof(struct STREAMINFO)+esinfo_len);
}
@@ -363,7 +379,8 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
if (macontext.General.VPid.Num)
{
- dsyslog("markad [%i]: using %s-video",recvnumber,macontext.General.H264 ? "H264": "H262");
+ dsyslog("markad [%i]: using %s-video (0x%04x)",recvnumber,macontext.General.H264 ? "H264": "H262",
+ macontext.General.VPid.Num);
video_demux = new cMarkAdDemux(recvnumber);
}
else
@@ -373,7 +390,7 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
if (macontext.General.APid.Num)
{
- dsyslog("markad [%i]: using mp2",recvnumber);
+ dsyslog("markad [%i]: using mp2 (0x%04x)",recvnumber,macontext.General.APid.Num);
mp2_demux = new cMarkAdDemux(recvnumber);
}
else
@@ -383,7 +400,7 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
if (macontext.General.DPid.Num)
{
- dsyslog("markad [%i]: using ac3",recvnumber);
+ dsyslog("markad [%i]: using ac3 (0x%04x)",recvnumber,macontext.General.DPid.Num);
ac3_demux = new cMarkAdDemux(recvnumber);
}
else
diff --git a/markad-standalone.h b/markad-standalone.h
index e6693b6..b1dc0ce 100644
--- a/markad-standalone.h
+++ b/markad-standalone.h
@@ -131,9 +131,17 @@ unsigned reserved2:
4;
unsigned ES_info_length_L:
8;
- };
+};
#pragma pack()
+struct ES_DESCRIPTOR {
+unsigned Descriptor_Tag:
+ 8;
+unsigned Descriptor_Length:
+ 8;
+};
+
+
cMarkAdDemux *video_demux;
cMarkAdDemux *ac3_demux;
cMarkAdDemux *mp2_demux;
diff --git a/recv.cpp b/recv.cpp
index 04a2c17..7be6d62 100644
--- a/recv.cpp
+++ b/recv.cpp
@@ -24,13 +24,13 @@ cMarkAdReceiver::cMarkAdReceiver(int RecvNumber, const char *Filename, cTimer *T
buffer.SetTimeouts(0, 10);
bool useH264=false;
-#if APIVERSNUM >= 10700 && APIVERSNUM < 10702
+#if APIVERSNUM >= 10700
+#ifdef DVBFE_DELSYS_DVBS2
if (Timer->Channel()->System()==DVBFE_DELSYS_DVBS2) useH264=true;
-#endif
-
-#if APIVERSNUM >= 10702
+#else
if (Timer->Channel()->System()==SYS_DVBS2) useH264=true;
#endif
+#endif
memset(&macontext,0,sizeof(macontext));
if (Timer->Event())
{