[mythtv] [Mythtv-developers] Possible problem with mythcommflag

Chris Pinkham cpinkham at bc2va.org
Sun Apr 8 00:27:29 UTC 2007

* On Sat Apr 07, 2007 at 04:54:01PM -0700, Robert Tsai wrote:
> On Sat, Apr 07, 2007 at 01:58:38PM +0100, Paul Harrison wrote:
> > I think there could be a problem with the cut list generated by 
> > mythcommflag if it thinks a file starts with a commercial. The first 
> > mark is set to 1 for the  MARK_COMM_START but I think it should be set 
> > to 0 but don't know enough about it to be sure. Having it set to 1 
> > causes the lossless transcoder to add some junk at the start which then 
> > causes mythreplex problems if its used by MythArchive. Using 0 as the 
> > first frame seems to fix things. Basically should a mark set to the 
> > first frame in a file be 0 or 1?
> I believe frame numbers are numbered starting with 0.

I haven't looked at this in a long long time, but I think originally there
was an issue with certain decoders starting at 1 instead of 0.  It may have
been fixed along the way or it may be a figment of my imagination.

On line 1058 in ClassicCommDetector.cpp, there is a line like this:

	curFrame = 1;

Above that, we declare "long curFrame = 0;", so I can't remember the
reason for setting it to zero then almost immediately setting it to
1.  I think it was because of this decoder issue, but am not 100% sure.
Evidently that line has been in the code since I added the "All" method,
so it dates back to the days when I was coding and testing "All".

You can try changing that "curFrame = 1;" to this if you want:

	if (!frameInfo.contains(0))
		curFrame = 1;

That will set curFrame to 1 only if we didn't find a frameNumber == 0
when processing the file.

All this assumes you are using the All method.  It looks like the
blank frame and scene change detectors start at 0.  That means that
the decoders must all start at 0 or else we would have heard of
other issues, so you could try commenting out the "curFrame = 1;"
line and seeing if you run into any issues.


More information about the mythtv-dev mailing list