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.
This commit is contained in:
jp9000 2020-09-03 05:31:18 -07:00
parent 4869167f5c
commit b99613b677

View file

@ -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();