forked from mia/Aegisub
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:
parent
2e9439c9f5
commit
a7760db77b
1 changed files with 8 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue