From b99613b67752867425318b60e690feb3b0c6e49f Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 3 Sep 2020 05:31:18 -0700 Subject: [PATCH] UI: Fix auto-remux not working w/ slash filesnames When the feature was added to allow slashes in recording/replay filenames to automatically create directories, auto-remux was not accounted for, and all filenames were assumed to be complete. It used fi.completeBaseName() to construct the new name which would only add the last part after the last slash as the filename, causing the remuxed file to save in the base directory rather than the intended directory. This fixes that by simply using the input string as the output string, removing the extension, appending the new extension. --- UI/window-basic-main.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 02dbc419f..76d971715 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5847,17 +5847,16 @@ void OBSBasic::AutoRemux() input += remuxFilename.c_str(); QFileInfo fi(remuxFilename.c_str()); + QString suffix = fi.suffix(); /* do not remux if lossless */ - if (fi.suffix().compare("avi", Qt::CaseInsensitive) == 0) { + if (suffix.compare("avi", Qt::CaseInsensitive) == 0) { return; } - QString output; - output += path; - output += "/"; - output += fi.completeBaseName(); - output += ".mp4"; + QString output = input; + output.resize(output.size() - suffix.size()); + output += "mp4"; OBSRemux *remux = new OBSRemux(path, this, true); remux->show();