[mythtv] Logo Detection Segfault/structure

Dale Osowski osowski at radiolink.net
Tue Mar 9 22:59:05 EST 2004

Hash: SHA1

Hello all.  I'm new to the project, and am happy with the results so far.

I've been trying out the logo detection method of commercial skipping, and
have had it frequently segfault when a new recording starts.  There was a
backtrace posted recently by Christian Hoenig (so I won't post a new one
unless requested) appearing in CheckStationLogo(), that shows a segfault
in the same location it is happening for me, although for me it is simply
right at the beginning of a recording.  It appears that it is coming from
the fact that logoMinX, logoMinY, logoMaxX, and logoMaxY are being used
with uninitialized values.

It's been a while since I've done much with C++, but I dug around a bit,
and it appears that what is happening is that ProcessNextFrame() is being
run from WriteVideo() in NuppleVideoRecorder, but SearchForLogo() is not
being executed at all.  As a result, logoMinX, etc. are not being set to
sane values, ending up with an out-of-bounds index for the logoCheckMask
array lookup.

I may be a bit off on this, but it appears to me that the problem in
fixing this is that the algorithm needs to search through a portion of the
recorded video in order to identify a station logo, but when
ProcessNextFrame() is run at the beginning of the recording, there is no
actual video (only one frame available) to use for logo identification.
I am thinking the logo method as implemented does not seem to work well
with the same on-the-fly commercial detection the blank-frame method
uses during recording, due to the additional information needed.

If my evaluation is correct, I see three possible solutions: buffer the
frames until the logo has been identified (bad idea?), do the detection
only after the logo has been identified (re-reading the frames from the
beginning once detection can begin), or just wait and do the full logo
ident/detect process after the recording is done (mythcommflag?).  I'm
still trying to understand the overall code structure, so I'm not sure yet
what kind of restructuring (if any) would need to be done to get these to
work.  Any thoughts?

- --
Dale Osowski
osowski at radiolink.net

Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6


More information about the mythtv-dev mailing list