Allow framerate transform to/from variable without external timecodes loaded
This is a potentially sensible operation (to convert from VFR to/from the video's average FPS), so there's no reason to require that the input and output timecodes be from different places. Closes #1530.
This commit is contained in:
parent
a56bf25d00
commit
89d7e0a321
3 changed files with 4 additions and 8 deletions
|
@ -139,8 +139,8 @@ void AssTransformFramerateFilter::LoadSettings(bool is_default, agi::Context *c)
|
|||
this->c = c;
|
||||
|
||||
if (is_default) {
|
||||
Input = &c->videoController->VFR_Input;
|
||||
Output = &c->videoController->VFR_Output;
|
||||
Input = &c->videoController->VideoFPS();
|
||||
Output = &c->videoController->FPS();
|
||||
}
|
||||
else {
|
||||
double temp;
|
||||
|
@ -152,7 +152,7 @@ void AssTransformFramerateFilter::LoadSettings(bool is_default, agi::Context *c)
|
|||
t2 = temp;
|
||||
Output = &t2;
|
||||
}
|
||||
else Output = &c->videoController->VFR_Output;
|
||||
else Output = &c->videoController->FPS();
|
||||
|
||||
if (Reverse->IsChecked()) {
|
||||
std::swap(Input, Output);
|
||||
|
|
|
@ -78,8 +78,6 @@ VideoContext::VideoContext()
|
|||
, arType(0)
|
||||
, hasSubtitles(false)
|
||||
, playAudioOnStep(OPT_GET("Audio/Plays When Stepping Video"))
|
||||
, VFR_Input(videoFPS)
|
||||
, VFR_Output(ovrFPS)
|
||||
{
|
||||
Bind(EVT_VIDEO_ERROR, &VideoContext::OnVideoError, this);
|
||||
Bind(EVT_SUBTITLES_ERROR, &VideoContext::OnSubtitlesError, this);
|
||||
|
|
|
@ -150,9 +150,6 @@ class VideoContext : public wxEvtHandler {
|
|||
void Reset();
|
||||
|
||||
public:
|
||||
const agi::vfr::Framerate &VFR_Input;
|
||||
const agi::vfr::Framerate &VFR_Output;
|
||||
|
||||
VideoContext();
|
||||
~VideoContext();
|
||||
|
||||
|
@ -261,6 +258,7 @@ public:
|
|||
bool TimecodesLoaded() const { return videoFPS.IsLoaded() || ovrFPS.IsLoaded(); };
|
||||
|
||||
const agi::vfr::Framerate& FPS() const { return ovrFPS.IsLoaded() ? ovrFPS : videoFPS; }
|
||||
const agi::vfr::Framerate& VideoFPS() const { return videoFPS; }
|
||||
|
||||
int TimeAtFrame(int frame, agi::vfr::Time type = agi::vfr::EXACT) const;
|
||||
int FrameAtTime(int time, agi::vfr::Time type = agi::vfr::EXACT) const;
|
||||
|
|
Loading…
Reference in a new issue