[mythtv] [PATCH] db error with duplicate GOPs

Chris Pinkham cpinkham at bc2va.org
Sat Jun 12 11:09:01 EDT 2004

> Some HDTV streams seem to have duplicate GOP markers.  With the old, 
> monolithic positionmap database updating code, this was not a problem 
> since the map would squash the duplicates.  With the new delta-based 
> code, it causes a MySQL duplicate db entry error if a duplicate is 
> entered since the last time the delta map was cleared. The db error 
> upsets the system enough to cause a hiccup in the recorded video.  The 
> attached patch fixes this situation.
> -Doug

<patch snipped>

I think this can be fixed much simpler by just changing the following
two lines from this:

                           positionMap[frameNum] = startpos;
                           positionMapDelta[frameNum] = startpos;

to this:

                           if (!positionMap.contains(frameNum))
                               positionMapDelta[frameNum] = startpos;
                           positionMap[frameNum] = startpos;

That way the delta map doesn't get entries added that are already in
the positionMap.  I made this change and similar changes in the other
*ecorder.cpp files and just committed them to CVS.  Can you update and
make sure the problem is fixed for you?

Theoretically it could/should even be this:

                           if (!positionMap.contains(frameNum))
                               positionMapDelta[frameNum] = startpos;
                               positionMap[frameNum] = startpos;

but it shouldn't negatively affect things the way it is.  It's a tossup
whether the positionmap should point to the first occurance of the
frame/GOP or the latest.



More information about the mythtv-dev mailing list