Default to 25 FPS if there are too few frames in a video to compute the FPS

Originally committed to SVN as r5683.
This commit is contained in:
Thomas Goyne 2011-09-29 20:27:23 +00:00
parent 32463efb08
commit 62181365b9
1 changed files with 4 additions and 1 deletions

View File

@ -253,6 +253,9 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
int Timestamp = (int)((CurFrameData->PTS * TimeBase->Num) / TimeBase->Den); int Timestamp = (int)((CurFrameData->PTS * TimeBase->Num) / TimeBase->Den);
TimecodesVector.push_back(Timestamp); TimecodesVector.push_back(Timestamp);
} }
if (TimecodesVector.size() < 2)
Timecodes = 25.0;
else
Timecodes = agi::vfr::Framerate(TimecodesVector); Timecodes = agi::vfr::Framerate(TimecodesVector);
FrameNumber = 0; FrameNumber = 0;