From 9794bbc6ca8d82382fe68d1fd37dac89b556f3dd Mon Sep 17 00:00:00 2001 From: Setsugennoao <41454651+Setsugennoao@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:40:14 +0200 Subject: [PATCH] Add getArgsForSourceFilter --- src/shared/WobblyProject.cpp | 9 ++++++++- src/wibbly/WibblyJob.cpp | 10 ++++++++-- src/wobbly/WobblyWindow.cpp | 7 ++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/shared/WobblyProject.cpp b/src/shared/WobblyProject.cpp index e60c8b3..15459fe 100644 --- a/src/shared/WobblyProject.cpp +++ b/src/shared/WobblyProject.cpp @@ -4128,8 +4128,15 @@ void WobblyProject::presetsToScript(std::string &script) const { } +const char *getArgsForSourceFilter() { + if (source_filter == "bs.VideoSource") + return ", rff=True"; + return ""; +} + + void WobblyProject::sourceToScript(std::string &script, bool save_node) const { - std::string src = "src = c." + source_filter + "(r'" + handleSingleQuotes(input_file) + "')\n"; + std::string src = "src = c." + source_filter + "(r'" + handleSingleQuotes(input_file) + "'" + getArgsForSourceFilter() +")\n"; if (save_node) { script += diff --git a/src/wibbly/WibblyJob.cpp b/src/wibbly/WibblyJob.cpp index 254f5dc..903a124 100644 --- a/src/wibbly/WibblyJob.cpp +++ b/src/wibbly/WibblyJob.cpp @@ -235,6 +235,12 @@ void WibblyJob::headerToScript(std::string &script) const { "\n"; } +const char *getArgsForSourceFilter() { + if (source_filter == "bs.VideoSource") + return ", rff=True"; + return ""; +} + void WibblyJob::sourceToScript(std::string &script) const { std::string fixed_input_file = handleSingleQuotes(input_file); @@ -246,10 +252,10 @@ void WibblyJob::sourceToScript(std::string &script) const { " if isinstance(src, vs.VideoOutputTuple):\n" " src = src[0]\n" " except KeyError:\n" - " src = c." + source_filter + "(r'" + fixed_input_file + "')\n" + " src = c." + source_filter + "(r'" + fixed_input_file + "'" + getArgsForSourceFilter() + ")\n" " src.set_output(index=1)\n" "else:\n" - " src = c." + source_filter + "(r'" + fixed_input_file + "')\n" + " src = c." + source_filter + "(r'" + fixed_input_file + "'" + getArgsForSourceFilter() + ")\n" " src.set_output(index=1)\n" " wibbly_last_input_file = r'" + fixed_input_file + "'\n" "\n"; diff --git a/src/wobbly/WobblyWindow.cpp b/src/wobbly/WobblyWindow.cpp index ac122be..31a26e3 100644 --- a/src/wobbly/WobblyWindow.cpp +++ b/src/wobbly/WobblyWindow.cpp @@ -3878,6 +3878,11 @@ void WobblyWindow::openProject() { } } +const char *getArgsForSourceFilter() { + if (source_filter == "bs.VideoSource") + return ", rff=True"; + return ""; +} void WobblyWindow::realOpenVideo(const QString &path) { try { @@ -3897,7 +3902,7 @@ void WobblyWindow::realOpenVideo(const QString &path) { "\n" "c = vs.core\n" "\n" - "c.%1(r'%2').set_output()\n"); + "c.%1(r'%2'" + getArgsForSourceFilter() +").set_output()\n"); script = script.arg(source_filter).arg(QString::fromStdString(handleSingleQuotes(path.toStdString()))); QApplication::setOverrideCursor(Qt::WaitCursor);