Adjust the way VFR is handled in VideoContext::SetVideo; should be cleaner and less prone to odd bugs now (hopefully). Doesn't try to set CFR framerates on VFR videos anymore, for one thing. Fixes #864.

Originally committed to SVN as r3084.
This commit is contained in:
Karl Blomster 2009-06-24 18:16:03 +00:00
parent 2e9439c9f5
commit a7760db77b

View file

@ -288,14 +288,17 @@ void VideoContext::SetVideo(const wxString &filename) {
// Set frame rate
fps = provider->GetFPS();
if (!isVfr || provider->IsNativelyByFrames()) {
VFR_Input.SetCFR(fps);
if (VFR_Output.GetFrameRateType() != VFR) VFR_Output.SetCFR(fps);
}
else {
// if the source is vfr and the provider isn't frame-based (i.e. is dshow),
// we need to jump through some hoops to make VFR work properly.
if (!provider->IsNativelyByFrames() && isVfr) {
FrameRate temp = provider->GetTrueFrameRate();
provider->OverrideFrameTimeList(temp.GetFrameTimeList());
}
// source not VFR? set as CFR
else if (!isVfr) {
VFR_Input.SetCFR(fps);
if (VFR_Output.GetFrameRateType() != VFR) VFR_Output.SetCFR(fps);
}
// Gather video parameters
length = provider->GetFrameCount();