[mythtv] Mythcommflag final commercial break

Jim Stichnoth stichnot at gmail.com
Sun Nov 20 18:21:28 UTC 2011


Lately I've been noticing that mythcommflag often leaves a 1-2 second
non-break section at the end of a recording, when it looks like the
last commercial break should actually extend to the end of the
recording.  This appears to be the result of line 1810 of
ClassicCommDetector.cpp, which is the last statement excerpted below:

    if ((breakStart != -1) &&
        (breakStart <= ((int64_t)framesProcessed - (int64_t)(2 * fps) - 2)))
    {
        if (verboseDebugging)
            LOG(VB_COMMFLAG, LOG_DEBUG,
                QString("Closing final commercial block started at "
                        "block %1 and going to end of program. length "
                        "is %2 frames")
                    .arg(curBlock)
                    .arg((framesProcessed - breakStart - 1)));

        commBreakMap[breakStart] = MARK_COMM_START;
        commBreakMap[framesProcessed - (int)(2 * fps) - 2] = MARK_COMM_END;
    }

Removing that statement leaves an open-ended commercial break, which
seems to work just fine.  Is there any reason not to do that?

Jim


More information about the mythtv-dev mailing list