summaryrefslogtreecommitdiff
path: root/command
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-09-20 22:35:29 +0200
committerJochen Dolze <vdr@dolze.de>2010-09-20 22:35:29 +0200
commitb5cf72992ac7dc034c26ed43685ef77c07a36dfe (patch)
treee8e7934ee8f33d878433b8869715742d6570ceab /command
parente43a5a081f909b0804646e076106b8e2e4bb7863 (diff)
downloadvdr-plugin-markad-b5cf72992ac7dc034c26ed43685ef77c07a36dfe.tar.gz
vdr-plugin-markad-b5cf72992ac7dc034c26ed43685ef77c07a36dfe.tar.bz2
Added vpkt and apkt usage in second pass
Diffstat (limited to 'command')
-rw-r--r--command/decoder.cpp4
-rw-r--r--command/markad-standalone.cpp29
-rw-r--r--command/markad-standalone.h2
3 files changed, 18 insertions, 17 deletions
diff --git a/command/decoder.cpp b/command/decoder.cpp
index 49174f3..87619de 100644
--- a/command/decoder.cpp
+++ b/command/decoder.cpp
@@ -128,6 +128,10 @@ cMarkAdDecoder::cMarkAdDecoder(bool useH264, bool useMP2, bool hasAC3)
return;
}
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(41<<8)+0)
+ tsyslog("libavcodec config: %s",avcodec_configuration());
+#endif
+
if (((ver >> 16)<52) && (useH264))
{
esyslog("dont report bugs about H264, use libavcodec >= 52 instead!");
diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp
index 5563105..2cdd512 100644
--- a/command/markad-standalone.cpp
+++ b/command/markad-standalone.cpp
@@ -757,7 +757,6 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
{
if (abort) return false;
- //const int datalen=8272;
const int datalen=319976;
uchar data[datalen];
@@ -799,14 +798,12 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
if ((video_demux) && (video) && (decoder) && (streaminfo))
{
- MarkAdPacket pkt;
-
uchar *tspkt = data;
int tslen = dataread;
while (tslen>0)
{
- int len=video_demux->Process(macontext.Info.VPid,tspkt,tslen,&pkt);
+ int len=video_demux->Process(macontext.Info.VPid,tspkt,tslen,&vpkt);
if (len<0)
{
esyslog("error demuxing video");
@@ -815,10 +812,10 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
}
else
{
- if (pkt.Data)
+ if (vpkt.Data)
{
bool dRes=false;
- if (streaminfo->FindVideoInfos(&macontext,pkt.Data,pkt.Length))
+ if (streaminfo->FindVideoInfos(&macontext,vpkt.Data,vpkt.Length))
{
actframe++;
framecnt2++;
@@ -835,11 +832,11 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
{
iframe=actframe-1;
}
- iframetime=pkt.Timestamp;
+ iframetime=vpkt.Timestamp;
dRes=true;
}
}
- if (pn>1) dRes=decoder->DecodeVideo(&macontext,pkt.Data,pkt.Length);
+ if (pn>1) dRes=decoder->DecodeVideo(&macontext,vpkt.Data,vpkt.Length);
if (dRes)
{
if ((actframe-iframe)<=3)
@@ -859,7 +856,7 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
}
tspkt+=len;
tslen-=len;
- if (!pkt.Offcnt)
+ if (!vpkt.Offcnt)
{
offset_add+=len;
}
@@ -875,14 +872,12 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
if ((mp2_demux) && (audio) && (pn!=3))
{
- MarkAdPacket pkt;
-
uchar *tspkt = data;
int tslen = dataread;
while (tslen>0)
{
- int len=mp2_demux->Process(macontext.Info.APid,tspkt,tslen,&pkt);
+ int len=mp2_demux->Process(macontext.Info.APid,tspkt,tslen,&apkt);
if (len<0)
{
esyslog("error demuxing mp2-audio");
@@ -890,13 +885,13 @@ bool cMarkAdStandalone::ProcessFile2ndPass(clMark **Mark1, clMark **Mark2,int Nu
}
else
{
- if (pkt.Data)
+ if (apkt.Data)
{
- if (pkt.Timestamp) audiotime=pkt.Timestamp;
+ if (apkt.Timestamp) audiotime=apkt.Timestamp;
- if (abs(audiotime-lastiframetime)<20000)
+ if (abs(audiotime-lastiframetime)<DELTATIME)
{
- if (decoder->DecodeMP2(&macontext,pkt.Data,pkt.Length))
+ if (decoder->DecodeMP2(&macontext,apkt.Data,apkt.Length))
{
pos=audio->Process2ndPass(iframe);
if (pos) ChangeMarks(Mark1,NULL,pos);
@@ -1172,7 +1167,7 @@ bool cMarkAdStandalone::ProcessFile(int Number)
}
if (apkt.Timestamp) audiotime=apkt.Timestamp;
- if (abs(audiotime-lastiframetime)<20000)
+ if (abs(audiotime-lastiframetime)<DELTATIME)
{
//printf("AC3 %5i %s %x\n",lastiframe,Timestamp2HMS(audiotime),audiotime);
mark=audio->Process(lastiframe,iframe);
diff --git a/command/markad-standalone.h b/command/markad-standalone.h
index 3dfea10..c6d2ff9 100644
--- a/command/markad-standalone.h
+++ b/command/markad-standalone.h
@@ -21,6 +21,8 @@
#define IGNORE_AUDIOINFO 2
#define IGNORE_TIMERINFO 4
+#define DELTATIME 20000 /* equals to 222ms (base is 90kHz PTS) */
+
class cOSDMessage
{
private: