Index: libs/libmyth/programinfo.h
===================================================================
--- libs/libmyth/programinfo.h	(revision 21444)
+++ libs/libmyth/programinfo.h	(working copy)
@@ -83,6 +83,11 @@
     /* Scene detection doesn't seem to be too useful (in the USA); there *
      * are just too many false positives from non-commercial cut scenes. */
     COMM_DETECT_2_ALL       = (COMM_DETECT_2_LOGO | COMM_DETECT_2_BLANK),
+
+    COMM_DETECT_PREPOSTROLL = 0x00000200,    
+    COMM_DETECT_PREPOSTROLL_ALL = (COMM_DETECT_PREPOSTROLL
+                                   | COMM_DETECT_BLANKS
+                                   | COMM_DETECT_SCENE)
 } SkipType;
 
 MPUBLIC QString SkipTypeToString(int);
Index: libs/libmyth/programinfo.cpp
===================================================================
--- libs/libmyth/programinfo.cpp	(revision 21444)
+++ libs/libmyth/programinfo.cpp	(working copy)
@@ -3499,6 +3499,7 @@
     bool scene = COMM_DETECT_SCENE & flags;
     bool logo  = COMM_DETECT_LOGO  & flags;
     bool exp   = COMM_DETECT_2     & flags;
+    bool prePst= COMM_DETECT_PREPOSTROLL & flags;
 
     if (blank && scene && logo)
         ret = QObject::tr("All Available Methods");
@@ -3517,6 +3518,8 @@
 
     if (exp)
         ret = QObject::tr("Experimental") + ": " + ret;
+    else if(prePst)
+        ret = QObject::tr("Pre & Post Roll") + ": " + ret;
 
     return ret;
 }
@@ -3530,6 +3533,7 @@
     tmp.push_back(COMM_DETECT_SCENE);
     tmp.push_back(COMM_DETECT_LOGO);
     tmp.push_back(COMM_DETECT_2 | COMM_DETECT_BLANK | COMM_DETECT_LOGO);
+    tmp.push_back(COMM_DETECT_PREPOSTROLL | COMM_DETECT_BLANK | COMM_DETECT_SCENE);
     return tmp;
 }
 
Index: programs/mythcommflag/mythcommflag.pro
===================================================================
--- programs/mythcommflag/mythcommflag.pro	(revision 21444)
+++ programs/mythcommflag/mythcommflag.pro	(working copy)
@@ -24,6 +24,7 @@
 HEADERS += HistogramAnalyzer.h
 HEADERS += BlankFrameDetector.h
 HEADERS += SceneChangeDetector.h
+HEADERS += PrePostRollFlagger.h
 
 HEADERS += LogoDetectorBase.h SceneChangeDetectorBase.h
 HEADERS += SlotRelayer.h CustomEventRelayer.h
@@ -43,6 +44,7 @@
 SOURCES += HistogramAnalyzer.cpp
 SOURCES += BlankFrameDetector.cpp
 SOURCES += SceneChangeDetector.cpp
+SOURCES += PrePostRollFlagger.cpp
 
 SOURCES += main.cpp
 
Index: programs/mythcommflag/PrePostRollFlagger.h
===================================================================
--- programs/mythcommflag/PrePostRollFlagger.h	(revision 0)
+++ programs/mythcommflag/PrePostRollFlagger.h	(revision 0)
@@ -0,0 +1,35 @@
+#ifndef PREPOSTROLLFLAGGER_H
+#define PREPOSTROLLFLAGGER_H
+
+#include "ClassicCommDetector.h"
+
+class PrePostRollFlagger : public ClassicCommDetector
+{
+public:
+    PrePostRollFlagger(SkipType commDetectMethod, bool showProgress,
+                            bool fullSpeed, NuppelVideoPlayer* nvp,
+                            const QDateTime& startedAt_in,
+                            const QDateTime& stopsAt_in,
+                            const QDateTime& recordingStartedAt_in,
+                            const QDateTime& recordingStopsAt_in);
+
+    virtual void getCommercialBreakList(comm_break_t &comms);
+    virtual ~PrePostRollFlagger(){}
+    bool go();
+
+private:
+    long long myTotalFrames;
+    long long closestAfterPre;
+    long long closestBeforePre;
+    long long closestAfterPost;
+    long long closestBeforePost;
+
+    void Init();
+
+    long long findBreakInrange(long long start, long long end,
+                               long long totalFrames,
+                               long long &framesProcessed,
+                               QTime &flagTime, bool findLast);
+};
+
+#endif // PREPOSTROLLFLAGGER_H
Index: programs/mythcommflag/ClassicCommDetector.h
===================================================================
--- programs/mythcommflag/ClassicCommDetector.h	(revision 21444)
+++ programs/mythcommflag/ClassicCommDetector.h	(working copy)
@@ -20,6 +20,15 @@
 class LogoDetectorBase;
 class SceneChangeDetectorBase;
 
+enum frameMaskValues {
+    COMM_FRAME_SKIPPED       = 0x0001,
+    COMM_FRAME_BLANK         = 0x0002,
+    COMM_FRAME_SCENE_CHANGE  = 0x0004,
+    COMM_FRAME_LOGO_PRESENT  = 0x0008,
+    COMM_FRAME_ASPECT_CHANGE = 0x0010,
+    COMM_FRAME_RATING_SYMBOL = 0x0020
+};
+
 class FrameInfoEntry
 {
   public:
@@ -82,9 +91,6 @@
         }
         FrameBlock;
 
-        void Init();
-        void SetVideoParams(float aspect);
-        void ProcessFrame(VideoFrame *frame, long long frame_number);
         void ClearAllMaps(void);
         void GetBlankCommMap(comm_map_t &comms);
         void GetBlankCommBreakMap(comm_map_t &comms);
@@ -106,17 +112,10 @@
         void GetLogoCommBreakMap(comm_map_t &map);
 
         enum SkipTypes commDetectMethod;
-        bool showProgress;
-        bool fullSpeed;
-        NuppelVideoPlayer *nvp;
-        QDateTime startedAt, stopsAt;
-        QDateTime recordingStartedAt, recordingStopsAt;
-        bool stillRecording;
         QMap<long long,int> lastSentCommBreakMap;
         bool commBreakMapUpdateRequested;
         bool sendCommBreakMapUpdates;
 
-        bool aggressiveDetection;
         int commDetectBorder;
         int commDetectBlankFrameMaxDiff;
         int commDetectDarkBrightness;
@@ -138,15 +137,11 @@
         int height;
         int horizSpacing;
         int vertSpacing;
-        double fps;
         double fpm;
         bool blankFramesOnly;
         int blankFrameCount;
         int currentAspect;
 
-        long long framesProcessed;
-        long long preRoll;
-        long long postRoll;
 
         int totalMinBrightness;
 
@@ -161,7 +156,6 @@
 
         unsigned char *framePtr;
 
-        QMap<long long, FrameInfoEntry> frameInfo;
         comm_map_t blankFrameMap;
         comm_map_t blankCommMap;
         comm_map_t blankCommBreakMap;
@@ -180,6 +174,25 @@
 
         SceneChangeDetectorBase* sceneChangeDetector;
 
+protected:
+        NuppelVideoPlayer *nvp;
+        QDateTime startedAt, stopsAt;
+        QDateTime recordingStartedAt, recordingStopsAt;
+        bool aggressiveDetection;
+        bool stillRecording;
+        bool fullSpeed;
+        bool showProgress;
+        double fps;
+        long long framesProcessed;
+        long long preRoll;
+        long long postRoll;
+
+
+        void Init();
+        void SetVideoParams(float aspect);
+        void ProcessFrame(VideoFrame *frame, long long frame_number);
+        QMap<long long, FrameInfoEntry> frameInfo;
+
 public slots:
         void sceneChangeDetectorHasNewInformation(unsigned int framenum, bool isSceneChange,float debugValue);
 };
Index: programs/mythcommflag/CommDetectorFactory.cpp
===================================================================
--- programs/mythcommflag/CommDetectorFactory.cpp	(revision 21444)
+++ programs/mythcommflag/CommDetectorFactory.cpp	(working copy)
@@ -1,6 +1,7 @@
 #include "CommDetectorFactory.h"
 #include "ClassicCommDetector.h"
 #include "CommDetector2.h"
+#include "PrePostRollFlagger.h"
 
 class NuppelVideoPlayer;
 class RemoteEncoder;
@@ -17,6 +18,12 @@
     const QDateTime& recordingStopsAt,
     bool useDB)
 {
+    if(commDetectMethod & COMM_DETECT_PREPOSTROLL)
+    {
+        return new PrePostRollFlagger(commDetectMethod, showProgress, fullSpeed, nvp, startedAt, stopsAt, recordingStartedAt, recordingStopsAt);
+        //return new PrePostRollFlagger(commDetectMethod, showProgress, fullSpeed,            nvp, startedAt, stopsAt, recordingStartedAt, recordingStopsAt);
+    }
+
     if ((commDetectMethod & COMM_DETECT_2))
     {
         return new CommDetector2(
Index: programs/mythcommflag/PrePostRollFlagger.cpp
===================================================================
--- programs/mythcommflag/PrePostRollFlagger.cpp	(revision 0)
+++ programs/mythcommflag/PrePostRollFlagger.cpp	(revision 0)
@@ -0,0 +1,439 @@
+#include "PrePostRollFlagger.h"
+
+// MythTV headers
+#include "mythcontext.h"
+#include "programinfo.h"
+#include "NuppelVideoPlayer.h"
+
+PrePostRollFlagger::PrePostRollFlagger(SkipType commDetectMethod,
+                            bool showProgress,bool fullSpeed,
+                            NuppelVideoPlayer* nvp,
+                            const QDateTime& startedAt_in,
+                            const QDateTime& stopsAt_in,
+                            const QDateTime& recordingStartedAt_in,
+                            const QDateTime& recordingStopsAt_in):
+    ClassicCommDetector( commDetectMethod,  showProgress,  fullSpeed,
+        nvp,            startedAt_in,       stopsAt_in,
+        recordingStartedAt_in,              recordingStopsAt_in),
+        myTotalFrames(0),                   closestAfterPre(0),
+        closestBeforePre(0),                closestAfterPost(0),
+        closestBeforePost(0)
+{
+}
+
+void PrePostRollFlagger::Init()
+{
+    ClassicCommDetector::Init();
+    nvp->SetExactSeeks(true);
+}
+
+bool PrePostRollFlagger::go()
+{
+    nvp->SetNullVideo();
+
+    int secsSince = 0;
+    int requiredBuffer = 120;
+    int requiredHeadStart = requiredBuffer;
+    bool wereRecording = stillRecording;
+
+    secsSince = startedAt.secsTo(QDateTime::currentDateTime());
+    while (stillRecording && (secsSince < requiredHeadStart))
+    {
+        emit statusUpdate("Waiting to pass preroll + head start");
+
+        emit breathe();
+        if (m_bStop)
+            return false;
+
+        sleep(5);
+        secsSince = startedAt.secsTo(QDateTime::currentDateTime());
+    }
+
+    if (nvp->OpenFile() < 0)
+        return false;
+
+    Init();
+
+
+    // Don't bother flagging short ~realtime recordings
+    if ((wereRecording) && (!stillRecording) && (secsSince < requiredHeadStart))
+        return false;
+
+    aggressiveDetection = gContext->GetNumSetting("AggressiveCommDetect", 1);
+
+    if (!nvp->InitVideo())
+    {
+        VERBOSE(VB_IMPORTANT,
+                "NVP: Unable to initialize video for FlagCommercials.");
+        return false;
+    }
+    nvp->SetCaptionsEnabled(false);
+
+    emit breathe();
+    if (m_bStop)
+        return false;
+
+    QTime flagTime;
+    flagTime.start();
+
+    if (recordingStopsAt < QDateTime::currentDateTime() )
+        myTotalFrames = nvp->GetTotalFrameCount();
+    else
+        myTotalFrames = (long long)(nvp->GetFrameRate() *
+                        (recordingStartedAt.secsTo(recordingStopsAt)));
+
+
+
+    if (showProgress)
+    {
+        if (myTotalFrames)
+            cerr << "  0%/      ";
+        else
+            cerr << "     0/      ";
+        cerr.flush();
+    }
+
+
+    float flagFPS;
+    float aspect = nvp->GetVideoAspect();
+
+    SetVideoParams(aspect);
+
+    emit breathe();
+
+    long long stopFrame = preRoll + fps * 120; //look up to 2 minutes past
+    long long framesToProcess = 0;
+    if(preRoll)
+        framesToProcess += stopFrame;
+    if(postRoll)
+        //guess two minutes before
+        framesToProcess += myTotalFrames - postRoll + fps * 120;
+
+
+    long long framesProcessed = 0;
+    if(preRoll > 0)
+    {
+        //check from preroll after
+        VERBOSE(VB_COMMFLAG, QString("Finding closest after preroll(%1-%2)")
+                .arg(preRoll).arg(stopFrame));
+
+        closestAfterPre = findBreakInrange(preRoll, stopFrame, framesToProcess,
+                                           framesProcessed, flagTime, false);
+
+        VERBOSE(VB_COMMFLAG, QString("Closest after preroll: %1")
+                .arg(closestAfterPre));
+
+
+        //check before preroll
+        long long startFrame = 0;
+        if(closestAfterPre)
+            startFrame = preRoll - (closestAfterPre - preRoll) - 1;
+
+        VERBOSE(VB_COMMFLAG, QString("Finding before preroll (%1-%2)")
+                .arg(startFrame).arg(preRoll));
+        closestBeforePre = findBreakInrange(startFrame, preRoll,
+                                            framesToProcess, framesProcessed,
+                                            flagTime, true);
+        VERBOSE(VB_COMMFLAG, QString("Closest before preroll: %1")
+                .arg(closestBeforePre));
+
+        if(closestBeforePre || closestAfterPre)
+            emit gotNewCommercialBreakList();
+
+        // for better processing percent
+        framesToProcess -= (stopFrame - framesProcessed);
+
+    }
+
+    if(stillRecording)
+    {
+        while (QDateTime::currentDateTime() <= recordingStopsAt)
+        {
+            emit breathe();
+            if (m_bStop)
+                return false;
+            emit statusUpdate("Waiting for recording to finish");
+            sleep(5);
+        }
+        stillRecording = false;
+         myTotalFrames = nvp->GetTotalFrameCount();
+    }
+
+    if(postRoll > 0)
+    {
+        //check from preroll after
+        long long postRollStartLoc = myTotalFrames - postRoll;
+        VERBOSE(VB_COMMFLAG, QString("Finding closest after postroll(%1-%2)")
+                .arg(postRollStartLoc).arg(myTotalFrames));
+        closestAfterPost = findBreakInrange(postRollStartLoc, myTotalFrames,
+                                            framesToProcess, framesProcessed, flagTime, false);
+        VERBOSE(VB_COMMFLAG, QString("Closest after postRoll: %1")
+                .arg(closestAfterPost));
+
+        //check before preroll
+        long long startFrame = 0;
+        if(closestAfterPost)
+            startFrame = postRollStartLoc
+                         - (closestAfterPost - postRollStartLoc) - 1;
+
+        VERBOSE(VB_COMMFLAG, QString("finding closest before preroll(%1-%2)")
+                .arg(startFrame).arg(postRollStartLoc));
+        closestBeforePost = findBreakInrange(startFrame, postRollStartLoc,
+                                             framesToProcess, framesProcessed,
+                                             flagTime, true);
+        VERBOSE(VB_COMMFLAG, QString("Closest before postroll: %1")
+                .arg(closestBeforePost));
+
+        framesToProcess = framesProcessed;
+    }
+
+    if (showProgress)
+    {
+        float elapsed = flagTime.elapsed() / 1000.0;
+
+        if (elapsed)
+            flagFPS = framesProcessed / elapsed;
+        else
+            flagFPS = 0.0;
+
+        if (myTotalFrames)
+            cerr << "\b\b\b\b\b\b      \b\b\b\b\b\b";
+        else
+            cerr << "\b\b\b\b\b\b\b\b\b\b\b\b\b             "
+                    "\b\b\b\b\b\b\b\b\b\b\b\b\b";
+        cerr.flush();
+    }
+
+    return true;
+}
+
+
+long long PrePostRollFlagger::findBreakInrange(long long startFrame,
+                                               long long stopFrame,
+                                               long long totalFrames,
+                                               long long &framesProcessed,
+                                             QTime &flagTime, bool findLast)
+{
+    float flagFPS;
+    int requiredBuffer = 30;
+    long long currentFrameNumber;
+
+    if(startFrame > 0)
+        startFrame--;
+    else
+        startFrame = 0;
+
+    long long tmpStartFrame = startFrame;
+    nvp->SetExactSeeks(true);
+    VideoFrame* f = nvp->GetRawVideoFrame(tmpStartFrame);
+    float aspect = nvp->GetVideoAspect();
+    currentFrameNumber = f->frameNumber;
+    VERBOSE(VB_COMMFLAG, QString("Starting with frame %1")
+            .arg(currentFrameNumber));
+    nvp->DiscardVideoFrame(f);
+
+    //some times we have to call twice to seek to the right spot
+    tmpStartFrame = startFrame;
+    f = nvp->GetRawVideoFrame(tmpStartFrame);
+    aspect = nvp->GetVideoAspect();
+    currentFrameNumber = f->frameNumber;
+    VERBOSE(VB_COMMFLAG, QString("Starting with frame(2) %1")
+            .arg(currentFrameNumber));
+    nvp->DiscardVideoFrame(f);
+
+    long long foundFrame = 0;
+
+    while (!nvp->GetEof())
+    {
+        struct timeval startTime;
+        if (stillRecording)
+            gettimeofday(&startTime, NULL);
+
+        VideoFrame* currentFrame = nvp->GetRawVideoFrame();
+        currentFrameNumber = currentFrame->frameNumber;
+
+        if(currentFrameNumber % 1000 == 0)
+        {
+            VERBOSE(VB_COMMFLAG, QString("Processing frame %1")
+                    .arg(currentFrameNumber));
+        }
+
+        if(currentFrameNumber > stopFrame || (!findLast && foundFrame))
+        {
+            nvp->DiscardVideoFrame(currentFrame);
+            break;
+        }
+
+        //Lucas: maybe we should make the nuppelvideoplayer send out a signal
+        //when the aspect ratio changes.
+        //In order to not change too many things at a time, I"m using basic
+        //polling for now.
+        double newAspect = nvp->GetVideoAspect();
+        if (newAspect != aspect)
+        {
+            SetVideoParams(aspect);
+            aspect = newAspect;
+        }
+
+        if (((currentFrameNumber % 500) == 0) ||
+            (((currentFrameNumber % 100) == 0) &&
+             (stillRecording)))
+        {
+            emit breathe();
+            if (m_bStop)
+            {
+                nvp->DiscardVideoFrame(currentFrame);
+                return false;
+            }
+        }
+
+        while (m_bPaused)
+        {
+            emit breathe();
+            sleep(1);
+        }
+
+        // sleep a little so we don't use all cpu even if we're niced
+        if (!fullSpeed && !stillRecording)
+            usleep(10000);
+
+        if (((currentFrameNumber % 500) == 0) ||
+            ((showProgress || stillRecording) &&
+             ((currentFrameNumber % 100) == 0)))
+        {
+            float elapsed = flagTime.elapsed() / 1000.0;
+
+            if (elapsed)
+                flagFPS = framesProcessed / elapsed;
+            else
+                flagFPS = 0.0;
+
+            int percentage;
+            if (stopFrame)
+                percentage = framesProcessed * 100 / totalFrames;
+            else
+                percentage = 0;
+
+            if (percentage > 100)
+                percentage = 100;
+
+            if (showProgress)
+            {
+                if (stopFrame)
+                {
+                    QString tmp = QString("\b\b\b\b\b\b\b\b\b\b\b%1%/%2fps")
+                        .arg(percentage, 3).arg((int)flagFPS, 3);
+                    QByteArray ba = tmp.toAscii();
+                    cerr << ba.constData() << flush;
+                }
+                else
+                {
+                    QString tmp = QString("\b\b\b\b\b\b\b\b\b\b\b\b\b%1/%2fps")
+                        .arg(currentFrameNumber, 6).arg((int)flagFPS, 3);
+                    QByteArray ba = tmp.toAscii();
+                    cerr << ba.constData() << flush;
+                }
+                cerr.flush();
+            }
+
+            if (stopFrame)
+                emit statusUpdate(QObject::tr("%1% Completed @ %2 fps.")
+                                  .arg(percentage).arg(flagFPS));
+            else
+                emit statusUpdate(QObject::tr("%1 Frames Completed @ %2 fps.")
+                                  .arg((long)currentFrameNumber).arg(flagFPS));
+        }
+
+        ProcessFrame(currentFrame, currentFrameNumber);
+
+        if(frameInfo[currentFrameNumber].flagMask &
+           (COMM_FRAME_SCENE_CHANGE | COMM_FRAME_BLANK))
+        {
+            foundFrame = currentFrameNumber;
+        }
+
+        if (stillRecording)
+        {
+            int secondsRecorded =
+                recordingStartedAt.secsTo(QDateTime::currentDateTime());
+            int secondsFlagged = (int)(framesProcessed / fps);
+            int secondsBehind = secondsRecorded - secondsFlagged;
+            long usecPerFrame = (long)(1.0 / nvp->GetFrameRate() * 1000000);
+
+            struct timeval endTime;
+            gettimeofday(&endTime, NULL);
+
+            long long usecSleep =
+                      usecPerFrame -
+                      (((endTime.tv_sec - startTime.tv_sec) * 1000000) +
+                       (endTime.tv_usec - startTime.tv_usec));
+
+            if (secondsBehind > requiredBuffer)
+            {
+                if (fullSpeed)
+                    usecSleep = 0;
+                else
+                    usecSleep = (long)(usecSleep * 0.25);
+            }
+            else if (secondsBehind < requiredBuffer)
+                usecSleep = (long)(usecPerFrame * 1.5);
+
+            if (usecSleep > 0)
+                usleep(usecSleep);
+        }
+
+        nvp->DiscardVideoFrame(currentFrame);
+        framesProcessed++;
+    }
+    return foundFrame;
+}
+
+
+void PrePostRollFlagger::getCommercialBreakList(comm_map_t &marks)
+{
+    VERBOSE(VB_COMMFLAG, "PrePostRollFlagger::GetCommBreakMap()");
+    marks.clear();
+
+    long long end = 0;
+    if(closestAfterPre && closestBeforePre)
+    {
+        //choose closest
+        if(closestAfterPre - preRoll < preRoll - closestBeforePre)
+            end = closestAfterPre;
+        else
+            end = closestBeforePre;
+    }else if(closestBeforePre)
+        end = closestBeforePre;
+    else if(closestAfterPre)
+        end  = closestAfterPre;
+    else
+        end = preRoll;
+
+    if(end)
+    {
+        marks[0] = MARK_COMM_START;
+        marks[end] = MARK_COMM_END;
+    }
+
+    long long start = 0;
+    if(closestAfterPost && closestBeforePost)
+    {
+        //choose closest
+        if(closestAfterPost - postRoll < postRoll - closestBeforePost)
+            start = closestAfterPost;
+        else
+            start = closestBeforePost;
+    }
+    else if(closestBeforePost)
+        start = closestBeforePost;
+    else if(closestAfterPost)
+        start  = closestAfterPre;
+    else if(postRoll)
+        start = myTotalFrames - postRoll;
+
+    if(start)
+    {
+        marks[start] = MARK_COMM_START;
+        marks[myTotalFrames] = MARK_COMM_END;
+    }
+}
Index: programs/mythcommflag/ClassicCommDetector.cpp
===================================================================
--- programs/mythcommflag/ClassicCommDetector.cpp	(revision 21444)
+++ programs/mythcommflag/ClassicCommDetector.cpp	(working copy)
@@ -22,15 +22,6 @@
 #include "ClassicLogoDetector.h"
 #include "ClassicSceneChangeDetector.h"
 
-enum frameMaskValues {
-    COMM_FRAME_SKIPPED       = 0x0001,
-    COMM_FRAME_BLANK         = 0x0002,
-    COMM_FRAME_SCENE_CHANGE  = 0x0004,
-    COMM_FRAME_LOGO_PRESENT  = 0x0008,
-    COMM_FRAME_ASPECT_CHANGE = 0x0010,
-    COMM_FRAME_RATING_SYMBOL = 0x0020
-} FrameMaskValues;
-
 enum frameAspects {
     COMM_ASPECT_NORMAL = 0,
     COMM_ASPECT_WIDE
@@ -132,28 +123,31 @@
                                          const QDateTime& stopsAt_in,
                                          const QDateTime& recordingStartedAt_in,
                                          const QDateTime& recordingStopsAt_in) :
-    commDetectMethod(commDetectMethod_in),     showProgress(showProgress_in),
-    fullSpeed(fullSpeed_in),                   nvp(nvp_in),
-    startedAt(startedAt_in),                   stopsAt(stopsAt_in),
-    recordingStartedAt(recordingStartedAt_in),
-    recordingStopsAt(recordingStopsAt_in),
-    stillRecording(recordingStopsAt > QDateTime::currentDateTime()),
+
+
+    commDetectMethod(commDetectMethod_in),
     commBreakMapUpdateRequested(false),        sendCommBreakMapUpdates(false),
-    aggressiveDetection(false),                verboseDebugging(false),
+    verboseDebugging(false),
     lastFrameNumber(0),                        curFrameNumber(0),
     width(0),                                  height(0),
     horizSpacing(0),                           vertSpacing(0),
-    fps(0.0),                                  fpm(0.0),
-    blankFramesOnly(false),                    blankFrameCount(0),
-    currentAspect(0),                          framesProcessed(0),
-    preRoll(0),                                postRoll(0),
+    fpm(0.0),                                  blankFramesOnly(false),
+    blankFrameCount(0),                        currentAspect(0),
     totalMinBrightness(0),                     detectBlankFrames(false),
     detectSceneChanges(false),                 detectStationLogo(false),
     logoInfoAvailable(false),                  logoDetector(0),
     framePtr(0),                               frameIsBlank(false),
     sceneHasChanged(false),                    stationLogoPresent(false),
     lastFrameWasBlank(false),                  lastFrameWasSceneChange(false),
-    decoderFoundAspectChanges(false),          sceneChangeDetector(0)
+    decoderFoundAspectChanges(false),          sceneChangeDetector(0),
+    nvp(nvp_in),
+    startedAt(startedAt_in),                   stopsAt(stopsAt_in),
+    recordingStartedAt(recordingStartedAt_in),
+    recordingStopsAt(recordingStopsAt_in),     aggressiveDetection(false),
+    stillRecording(recordingStopsAt > QDateTime::currentDateTime()),
+    fullSpeed(fullSpeed_in),                   showProgress(showProgress_in),
+    fps(0.0),                                  framesProcessed(0),
+    preRoll(0),                                postRoll(0)
 {
     commDetectBorder =
         gContext->GetNumSetting("CommDetectBorder", 20);
