[mythtv] [PATCH] db error with duplicate GOPs

Chris Pinkham cpinkham at bc2va.org
Sat Jun 12 16:24:01 EDT 2004

> Chris Pinkham wrote:
> > 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's essentially what I did, though I used .find() == .end() rather 
> than !.contains(), and I also skip subsequent processing as unnecessary 
> if the positionmaps haven't changed.
> Anyway, your patch will get the job done.  Thanks for getting this in 
> quickly.
> -Doug

Right you are... :)  I just changed it to to not even try the if statement
about the positionmapdelta size if the keyframe has been seen before.
Thanks for pointing that out.  It's in CVS now.

Goes to show that just because my way looked simpler doesn't mean it's as
good. :)  I assume that .find() and .contains() are pretty much the same code
underneath since one just returns true/false if found and the other returns
an iterator so I left the code using !.contains() for now.


More information about the mythtv-dev mailing list