[mythtv] possible error in auto-shutdown routine

Marc Kessels kessels at rijnh.nl
Thu Mar 4 10:04:37 EST 2004

At 14:03 4-3-2004, you wrote:
>On Thursday 04 March 2004 07:40, Marc Kessels wrote:
> > 919                   if ((recIter = reclist.begin()) !=
> > 920                           reclist.end())
> >
> > line 919 and 920 contain the error if I am not mistaking: I suppose the
> > assignment should be a compare (==) because now recIter contains the first
> > recording in the list, and not the first recording to still be recorded.
> > Therefor the time towards the next recording calculated in 922-923 becomes
> > negative.
>This isn't any of my code, so I'm not that familiar with it, but I don't 
>that 919 is a bug.  It's assigning the first position in reclist to recIter
>(an iterator), and comparing it to the last position.  If they're not equal,
>there's at least one value in the list (IIRC end() returns an iterator *past*
>the final list item).  The iterator is then used in 922 to refer to the first
>item in recList - if this list is sorted, this would be the next recording,
>which seems reasonable to me.

In principle I do agree with you, but apparently this recList contains more 
than only the recordings which are in the future. Therefor earlier in the 
code there are several check to find the first recording in the future. 
like this one:

756 for ( ; startIter != reclist.end(); startIter++)
757             if ((*startIter)->recstatus == rsWillRecord)
758                     break;

maybe I should have included this part in my earlier mail...


>Andrew Mahone
>andrewmahone AT eml DOT cc
>mythtv-dev mailing list
>mythtv-dev at mythtv.org

More information about the mythtv-dev mailing list