diff options
author | Jochen Dolze <vdr@dolze.de> | 2010-03-17 11:59:36 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2010-03-17 11:59:36 +0100 |
commit | c579345b78b87bfbe9b1ce4cbe1be50c0d9dd11a (patch) | |
tree | 0d11070937587948790575db9aa1188c62582497 | |
parent | 216d281a0ea6140a6c1e0190a3ea2ae9ff5e467a (diff) | |
download | vdr-plugin-markad-c579345b78b87bfbe9b1ce4cbe1be50c0d9dd11a.tar.gz vdr-plugin-markad-c579345b78b87bfbe9b1ce4cbe1be50c0d9dd11a.tar.bz2 |
Hopefully fixed frame counter error
-rw-r--r-- | decoder.cpp | 4 | ||||
-rw-r--r-- | markad-standalone.cpp | 19 | ||||
-rw-r--r-- | streaminfo.cpp | 24 | ||||
-rw-r--r-- | streaminfo.h | 1 |
4 files changed, 18 insertions, 30 deletions
diff --git a/decoder.cpp b/decoder.cpp index 8d98183..d2d8d18 100644 --- a/decoder.cpp +++ b/decoder.cpp @@ -347,10 +347,6 @@ bool cMarkAdDecoder::SetVideoInfos(MarkAdContext *maContext,AVCodecContext *Vide } maContext->Video.Info.Height=Video_Context->height; maContext->Video.Info.Width=Video_Context->width; - if (Video_Context->codec_id!=CODEC_ID_H264) - { - maContext->Video.Info.Pict_Type=Video_Context->coded_frame->pict_type; - } AVRational dar; PAR2DAR(Video_Context->sample_aspect_ratio,&dar); diff --git a/markad-standalone.cpp b/markad-standalone.cpp index 7929738..70844c6 100644 --- a/markad-standalone.cpp +++ b/markad-standalone.cpp @@ -166,22 +166,18 @@ bool cMarkAdStandalone::ProcessFile(const char *Directory, int Number) } //printf("%05i( %c )\n",framecnt,frametypes[macontext.Video.Info.Pict_Type]); framecnt++; + if (macontext.Video.Info.Pict_Type==MA_I_TYPE) + { + lastiframe=framecnt-1; + } } bool dRes=true; if ((decoder) && (bDecodeVideo)) dRes=decoder->DecodeVideo(&macontext,pkt,pktlen); if (dRes) { - if (macontext.Video.Info.Pict_Type==MA_I_TYPE) + if ((framecnt-lastiframe)<=3) { - if (!isTS) - { - lastiframe=framecnt-2; - } - else - { - lastiframe=framecnt-1; - } //SaveFrame(lastiframe); // TODO: JUST FOR DEBUGGING! mark=video->Process(lastiframe); AddMark(mark); @@ -610,12 +606,13 @@ bool cMarkAdStandalone::CheckPATPMT(const char *Directory) return true; } +const char cMarkAdStandalone::frametypes[8]={'?','I','P','B','D','S','s','b'}; + cMarkAdStandalone::cMarkAdStandalone(const char *Directory, bool BackupMarks, int LogoExtraction, int LogoWidth, int LogoHeight, bool DecodeVideo, bool DecodeAudio, bool IgnoreVideoInfo, bool IgnoreAudioInfo, const char *LogoDir, const char *MarkFileName) { - const char frametypes[8]={'?','I','P','B','D','S','s','b'}; recvnumber=255; abort=false; @@ -704,7 +701,7 @@ cMarkAdStandalone::cMarkAdStandalone(const char *Directory, bool BackupMarks, in if (!LoadInfo(Directory)) { - if (bDecodeVideo) esyslog("markad [%i]: failed loading info - logo detection impossible",recvnumber); + if (bDecodeVideo) esyslog("markad [%i]: failed loading info - logo detection disabled",recvnumber); } if (MarkFileName[0]) marks.SetFileName(MarkFileName); diff --git a/streaminfo.cpp b/streaminfo.cpp index f28b4e7..353440b 100644 --- a/streaminfo.cpp +++ b/streaminfo.cpp @@ -6,7 +6,7 @@ */ #include "streaminfo.h" -#include <stdio.h> + cMarkAdStreamInfo::cMarkAdStreamInfo() { memset(&H264,0,sizeof(H264)); @@ -409,18 +409,19 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, { bs.skipBits(2); // colour_plane_id } - int frame_num=bs.getBits(H264.log2_max_frame_num); // frame_num + bs.skipBits(H264.log2_max_frame_num); // frame_num maContext->Video.Info.Interlaced=false; if (!H264.frame_mbs_only_flag) { maContext->Video.Info.Interlaced=true; - bool field_pic_flag=bs.getBit(); - if (field_pic_flag) - { - bool bottom_field_flag=bs.getBit(); - if (bottom_field_flag) return false; - } + /* + bool field_pic_flag=bs.getBit(); + if (field_pic_flag) + { + bool bottom_field_flag=bs.getBit(); + } + */ } switch (slice_type) @@ -454,12 +455,7 @@ bool cMarkAdStreamInfo::FindH264VideoInfos(MarkAdContext *maContext, uchar *pkt, break; } maContext->Video.Info.Pict_Type=slice_type; - - if (frame_num!=H264.frame_num) - { - H264.frame_num=frame_num; - return true; - } + return true; } return false; } diff --git a/streaminfo.h b/streaminfo.h index 19e119c..dc712be 100644 --- a/streaminfo.h +++ b/streaminfo.h @@ -35,7 +35,6 @@ private: bool separate_colour_plane_flag; bool frame_mbs_only_flag; int log2_max_frame_num; - int frame_num; } H264; int nalUnescape(uint8_t *dst, const uint8_t *src, int len); |