summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--markad-standalone.cpp18
-rw-r--r--recv.cpp10
-rw-r--r--recv.h2
-rw-r--r--ts2pkt.cpp5
4 files changed, 28 insertions, 7 deletions
diff --git a/markad-standalone.cpp b/markad-standalone.cpp
index 3e6e8d1..7bd293e 100644
--- a/markad-standalone.cpp
+++ b/markad-standalone.cpp
@@ -312,16 +312,22 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory)
macontext.General.VPid.Type=MARKAD_PIDTYPE_VIDEO_H262;
}
- macontext.General.VPid.Num=0x3ff;
-// macontext.General.DPid.Num=0x403;
- macontext.General.APid.Num=0x0;
+ macontext.General.VPid.Num=0xa5;
+ //macontext.General.DPid.Num=0x403;
+ macontext.General.APid.Num=0x78;
video_demux = new cMarkAdDemux(255);
-// mp2_demux = new cMarkAdDemux(255);
- mp2_demux=NULL;
+ if (macontext.General.APid.Num)
+ {
+ mp2_demux = new cMarkAdDemux(255);
+ }
+
+ if (macontext.General.DPid.Num)
+ {
+ ac3_demux = new cMarkAdDemux(255);
+ }
- ac3_demux = new cMarkAdDemux(255);
decoder = new cMarkAdDecoder(255,index->isTS(),
macontext.General.DPid.Num!=0);
video = new cMarkAdVideo(255,&macontext);
diff --git a/recv.cpp b/recv.cpp
index f105aa4..78d3840 100644
--- a/recv.cpp
+++ b/recv.cpp
@@ -13,7 +13,7 @@ cMarkAdReceiver::cMarkAdReceiver(int RecvNumber, const char *Filename, cTimer *T
cReceiver(Timer->Channel()->GetChannelID(), -1,
Timer->Channel()->Vpid(),Timer->Channel()->Apids(),
Timer->Channel()->Dpids()),cThread("markad"),
- buffer(MEGABYTE(3)), running(false) // 3MB Buffer
+ buffer(MEGATS(3)), running(false) // 3MB Buffer
{
if ((!Filename) || (!Timer)) return;
@@ -249,6 +249,14 @@ void cMarkAdReceiver::Action()
uchar *tspkt = frame->Data();
int tslen = frame->Count();
+#if 0
+int w=open("/tmp/test.ts",O_CREAT|O_RDWR|O_APPEND,0644);
+if (w!=-1) {
+write(w,tspkt,tslen);
+close(w);
+}
+#endif
+
while (tslen>0)
{
int len=video_demux->Process(macontext.General.VPid,tspkt,tslen,&pkt,&pktlen);
diff --git a/recv.h b/recv.h
index fb7e5a0..4e61743 100644
--- a/recv.h
+++ b/recv.h
@@ -25,6 +25,8 @@
#include <linux/dvb/frontend.h>
#endif
+#define MEGATS(n) ((n)*1024*1880)
+
class cMarkAdRingBuffer : public cRingBufferFrame
{
private:
diff --git a/ts2pkt.cpp b/ts2pkt.cpp
index 08139b6..7d66c08 100644
--- a/ts2pkt.cpp
+++ b/ts2pkt.cpp
@@ -190,6 +190,11 @@ int cMarkAdTS2Pkt::Process(MarkAdPid Pid, uchar *TSData, int TSSize, uchar **Pkt
if ((counter!=-1) && (((counter+1) & 0xF)!=tshdr->Counter))
{
+ if (counter==tshdr->Counter)
+ {
+ // duplicate paket -> just ignore
+ return TS_SIZE;
+ }
// sequence error
Reset(MA_ERR_SEQ);
return TS_SIZE;