Ticket #788: commflag-svn_start_stop_times.3.patch
File commflag-svn_start_stop_times.3.patch, 5.5 KB (added by , 18 years ago) |
---|
-
programs/mythcommflag/ClassicCommDetector.cpp
old new 43 43 bool showProgress_in, 44 44 bool fullSpeed_in, 45 45 NuppelVideoPlayer* nvp_in, 46 const QDateTime& startedAt_in, 47 const QDateTime& stopsAt_in, 46 48 const QDateTime& recordingStartedAt_in, 47 49 const QDateTime& recordingStopsAt_in) : 48 50 commDetectMethod(commDetectMethod_in), 49 51 showProgress(showProgress_in), 50 52 fullSpeed(fullSpeed_in), 51 53 nvp(nvp_in), 54 startedAt(startedAt_in), 55 stopsAt(stopsAt_in), 52 56 recordingStartedAt(recordingStartedAt_in), 53 57 recordingStopsAt(recordingStopsAt_in), 54 58 framesProcessed(0) … … 248 252 249 253 int requiredHeadStart = 30; 250 254 if (commDetectMethod & COMM_DETECT_LOGO) 251 requiredHeadStart += commDetectLogoSecondsNeeded;255 requiredHeadStart += max(0,recordingStartedAt.secsTo(startedAt)) + commDetectLogoSecondsNeeded; 252 256 else 253 257 requiredHeadStart += 30; 254 258 … … 1136 1140 { 1137 1141 for (int i=0;i<COMM_FORMAT_MAX;i++) formatCounts[i]=0; 1138 1142 1139 for(long long i = 0; i < framesProcessed; i++ ) 1143 for(long long i = (max(0,recordingStartedAt.secsTo(startedAt))*(long)fps); 1144 i < (framesProcessed - (max(0,stopsAt.secsTo(recordingStopsAt))*(long)fps)); 1145 i++ ) 1140 1146 formatCounts[frameInfo[i].format]++; 1141 1147 1142 1148 for(int i = 0; i < COMM_FORMAT_MAX; i++) … … 2538 2544 nvp->DiscardVideoFrame(nvp->GetRawVideoFrame(0)); 2539 2545 2540 2546 loops = 0; 2541 seekFrame = seekIncrement;2547 seekFrame = max(0,recordingStartedAt.secsTo(startedAt)) + seekIncrement; 2542 2548 2543 2549 while(loops < maxLoops && !nvp->GetEof()) 2544 2550 { -
programs/mythcommflag/ClassicCommDetector.h
old new 12 12 public: 13 13 ClassicCommDetector(int commDetectMethod, bool showProgress, 14 14 bool fullSpeed, NuppelVideoPlayer* nvp, 15 const QDateTime& startedAt, 16 const QDateTime& stopsAt, 15 17 const QDateTime& recordingStartedAt, 16 18 const QDateTime& recordingStopsAt_in); 17 19 virtual ~ClassicCommDetector(); … … 94 96 bool showProgress; 95 97 bool fullSpeed; 96 98 NuppelVideoPlayer *nvp; 99 QDateTime startedAt, stopsAt; 97 100 QDateTime recordingStartedAt, recordingStopsAt; 98 101 bool stillRecording; 99 102 QMap<long long,int> lastSentCommBreakMap; -
programs/mythcommflag/CommDetectorFactory.cpp
old new 8 8 CommDetectorFactory::makeCommDetector(int commDetectMethod, 9 9 bool showProgress, bool fullSpeed, 10 10 NuppelVideoPlayer* nvp, 11 const QDateTime& startedAt, 12 const QDateTime& stopsAt, 11 13 const QDateTime& recordingStartedAt, 12 14 const QDateTime& recordingStopsAt) 13 15 { … … 16 18 //Future different CommDetect implementations will be created here. 17 19 default: 18 20 return new ClassicCommDetector(commDetectMethod, showProgress, 19 fullSpeed, nvp, recordingStartedAt, 21 fullSpeed, nvp, startedAt, 22 stopsAt, recordingStartedAt, 20 23 recordingStopsAt); 21 24 } 22 25 -
programs/mythcommflag/CommDetectorFactory.h
old new 25 25 26 26 CommDetectorBase* makeCommDetector(int commDetectMethod, bool showProgress, 27 27 bool fullSpeed, NuppelVideoPlayer* nvp, 28 const QDateTime& startedAt, 29 const QDateTime& stopsAt, 28 30 const QDateTime& recordingStartedAt, 29 const QDateTime& recordingStopsAt _in);31 const QDateTime& recordingStopsAt); 30 32 }; 31 33 32 34 #endif -
programs/mythcommflag/main.cpp
old new 301 301 CommDetectorFactory factory; 302 302 commDetector = factory.makeCommDetector(commDetectMethod, showPercentage, 303 303 fullSpeed, nvp, 304 program_info->startts, 305 program_info->endts, 304 306 program_info->recstartts, 305 307 program_info->recendts); 306 308