diff options
author | Jochen Dolze <vdr@dolze.de> | 2011-04-03 14:49:53 +0200 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2011-04-03 14:49:53 +0200 |
commit | 0b6cc044f9f44af88d8f115204cdae0b7dddd23c (patch) | |
tree | 27b6e650529f2ad06db6caad6fb18e2017d82a57 /command | |
parent | 6adc2d76929fb8549689080c3510d3ff926ef4d2 (diff) | |
download | vdr-plugin-markad-0b6cc044f9f44af88d8f115204cdae0b7dddd23c.tar.gz vdr-plugin-markad-0b6cc044f9f44af88d8f115204cdae0b7dddd23c.tar.bz2 |
Fixed another bug in handling ts files ("demux error")v0.1.2
Limited logo extraction to 1000 frames
Added more finnish logos
Added czech translation
Diffstat (limited to 'command')
-rw-r--r-- | command/logos/Jim-A16_9-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/MTV3_Juniori-A16_9-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/The_Voice_TV_Viisi-A16_9-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/The_Voice_TV_Viisi-A4_3-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/YLE_TV1-A16_9-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/YLE_TV2-A16_9-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/logos/YLE_TV2-A4_3-P0.pgm | bin | 0 -> 19219 bytes | |||
-rw-r--r-- | command/markad-standalone.cpp | 55 | ||||
-rw-r--r-- | command/markad-standalone.h | 1 | ||||
-rw-r--r-- | command/po/cs_CZ.po | 23 |
10 files changed, 59 insertions, 20 deletions
diff --git a/command/logos/Jim-A16_9-P0.pgm b/command/logos/Jim-A16_9-P0.pgm Binary files differnew file mode 100644 index 0000000..550ee45 --- /dev/null +++ b/command/logos/Jim-A16_9-P0.pgm diff --git a/command/logos/MTV3_Juniori-A16_9-P0.pgm b/command/logos/MTV3_Juniori-A16_9-P0.pgm Binary files differnew file mode 100644 index 0000000..182e565 --- /dev/null +++ b/command/logos/MTV3_Juniori-A16_9-P0.pgm diff --git a/command/logos/The_Voice_TV_Viisi-A16_9-P0.pgm b/command/logos/The_Voice_TV_Viisi-A16_9-P0.pgm Binary files differnew file mode 100644 index 0000000..6e74a85 --- /dev/null +++ b/command/logos/The_Voice_TV_Viisi-A16_9-P0.pgm diff --git a/command/logos/The_Voice_TV_Viisi-A4_3-P0.pgm b/command/logos/The_Voice_TV_Viisi-A4_3-P0.pgm Binary files differnew file mode 100644 index 0000000..5efc1bb --- /dev/null +++ b/command/logos/The_Voice_TV_Viisi-A4_3-P0.pgm diff --git a/command/logos/YLE_TV1-A16_9-P0.pgm b/command/logos/YLE_TV1-A16_9-P0.pgm Binary files differnew file mode 100644 index 0000000..063d7b3 --- /dev/null +++ b/command/logos/YLE_TV1-A16_9-P0.pgm diff --git a/command/logos/YLE_TV2-A16_9-P0.pgm b/command/logos/YLE_TV2-A16_9-P0.pgm Binary files differnew file mode 100644 index 0000000..0445bd8 --- /dev/null +++ b/command/logos/YLE_TV2-A16_9-P0.pgm diff --git a/command/logos/YLE_TV2-A4_3-P0.pgm b/command/logos/YLE_TV2-A4_3-P0.pgm Binary files differnew file mode 100644 index 0000000..cefeb1e --- /dev/null +++ b/command/logos/YLE_TV2-A4_3-P0.pgm diff --git a/command/markad-standalone.cpp b/command/markad-standalone.cpp index c2dc261..1ec9b7a 100644 --- a/command/markad-standalone.cpp +++ b/command/markad-standalone.cpp @@ -361,10 +361,35 @@ void cMarkAdStandalone::CheckStart() return; } +void cMarkAdStandalone::CheckLogoMarks() +{ + clMark *mark=marks.GetFirst(); + while (mark) + { + if ((mark->type==MT_LOGOSTOP) && mark->Next() && mark->Next()->type==MT_LOGOSTART) + { + int MARKDIFF=(int) (macontext.Video.Info.FramesPerSecond*30); + if (abs(mark->Next()->position-mark->position)<=MARKDIFF) + { + double distance=(mark->Next()->position-mark->position)/macontext.Video.Info.FramesPerSecond; + isyslog("mark distance too short (%.1fs), deleting %i,%i",distance, + mark->position,mark->Next()->position); + clMark *tmp=mark; + mark=mark->Next()->Next(); + marks.Del(tmp->Next()); + marks.Del(tmp); + continue; + } + } + mark=mark->Next(); + } +} + void cMarkAdStandalone::AddMark(MarkAdMark *Mark) { if (!Mark) return; if (!Mark->Type) return; + if ((macontext.Config) && (macontext.Config->logoExtraction!=-1)) return; if (gotendmark) return; char *comment=NULL; @@ -439,7 +464,7 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark) if (comment) isyslog("%s",comment); - if ((Mark->Type & 0x0F)==MT_STOP) + if (((Mark->Type & 0x0F)==MT_STOP) && (!iStart) && (Mark->Position<abs(iStop))) { clMark *prev=marks.GetPrev(Mark->Position,(Mark->Type & 0xF0)|MT_START); if (prev) @@ -458,7 +483,7 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark) double distance=(Mark->Position-prev->position)/macontext.Video.Info.FramesPerSecond; isyslog("mark distance too short (%.1fs), deleting %i,%i",distance, prev->position,Mark->Position); - if (((prev->type & 0x0F)==MT_START) && (!macontext.Video.Options.WeakMarksOk)) inBroadCast=false; + if (!macontext.Video.Options.WeakMarksOk) inBroadCast=false; marks.Del(prev); if (comment) free(comment); return; @@ -469,24 +494,6 @@ void cMarkAdStandalone::AddMark(MarkAdMark *Mark) clMark *prev=marks.GetLast(); if (prev) { - if ((Mark->Type==MT_LOGOSTART) && (!iStart) && (Mark->Position<abs(iStop))) - { - if (prev->type==MT_LOGOSTOP) - { - int MARKDIFF=(int) (macontext.Video.Info.FramesPerSecond*30); - if ((Mark->Position-prev->position)<MARKDIFF) - { - double distance=(Mark->Position-prev->position)/macontext.Video.Info.FramesPerSecond; - isyslog("mark distance too short (%.1fs), deleting %i,%i",distance, - prev->position,Mark->Position); - if (((prev->type & 0x0F)==MT_START) && (!macontext.Video.Options.WeakMarksOk)) inBroadCast=false; - marks.Del(prev); - if (comment) free(comment); - return; - } - } - } - if ((prev->type & 0x0F)==(Mark->Type & 0x0F)) { int MARKDIFF=(int) (macontext.Video.Info.FramesPerSecond*30); @@ -968,6 +975,13 @@ bool cMarkAdStandalone::ProcessFile(int Number) marks.WriteIndex(directory,isTS,demux->Offset(),macontext.Video.Info.Pict_Type,Number); } framecnt++; + if ((macontext.Config->logoExtraction!=-1) && (framecnt>=1000)) + { + isyslog("finished logo extraction"); + abort=true; + if (f!=-1) close(f); + return true; + } if (macontext.Video.Info.Pict_Type==MA_I_TYPE) { @@ -1100,6 +1114,7 @@ void cMarkAdStandalone::ProcessFile() if (!abort) { + CheckLogoMarks(); if (iStop>0) CheckStop(); // no stopmark till now? if ((inBroadCast) && (!gotendmark) && (lastiframe)) { diff --git a/command/markad-standalone.h b/command/markad-standalone.h index b87422e..cacbd0d 100644 --- a/command/markad-standalone.h +++ b/command/markad-standalone.h @@ -236,6 +236,7 @@ unsigned Descriptor_Length: bool CheckPATPMT(off_t Offset=0); bool CheckTS(); bool CheckLogo(); + void CheckLogoMarks(); bool LoadInfo(); bool SaveInfo(); bool SetFileUID(char *File); diff --git a/command/po/cs_CZ.po b/command/po/cs_CZ.po new file mode 100644 index 0000000..be08408 --- /dev/null +++ b/command/po/cs_CZ.po @@ -0,0 +1,23 @@ +# This file is distributed under the same license as the markad package. +# +msgid "" +msgstr "" +"Project-Id-Version: markad\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2010-05-27 15:32+0200\n" +"PO-Revision-Date: 2011-03-01 20:30+0100\n" +"Last-Translator: jiri dobry <jdobry@centrum.cz>\n" +"Language-Team: <vdr@linuxtv.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "starting markad for" +msgstr "start hledání reklamy pro" + +msgid "markad aborted for" +msgstr "vyhledávání reklamy zrušeno pro" + +msgid "markad finished for" +msgstr "vyhledávání reklamy skončilo pro" + |