Fix a bunch of edge cases in the VFR code. Patch by Plorkyeran, solves bugtracker issue #773.

Originally committed to SVN as r2721.
This commit is contained in:
Karl Blomster 2009-02-04 23:11:56 +00:00
parent d9d0eddfde
commit 6a765528e1
1 changed files with 4 additions and 3 deletions

View File

@ -170,8 +170,9 @@ void FrameRate::Load(wxString filename) {
lposition = lend; lposition = lend;
} }
AddFrame(currenttime);
last_time = currenttime; last_time = currenttime;
last_frame = (int)Frame.size(); last_frame = (int)Frame.size() - 1;
} }
// V2 // V2
@ -202,7 +203,7 @@ void FrameRate::Load(wxString filename) {
} }
last_time = cftime; last_time = cftime;
last_frame = (int)Frame.size(); last_frame = (int)Frame.size() - 1;
CalcAverage(); CalcAverage();
@ -305,7 +306,7 @@ int FrameRate::PFrameAtTime(int ms,bool useceil) {
trueLast = Frame[Frame.size()-1]; trueLast = Frame[Frame.size()-1];
// Inside VFR range // Inside VFR range
if (ms < trueLast) { if (ms <= trueLast) {
// Prepare binary search // Prepare binary search
size_t start = 0; size_t start = 0;
size_t end = last_frame; size_t end = last_frame;