소스 검색

UI: Use QFileInfo for remux

Using QFileInfo is better than mangling the string together ourselves
manually.
jp9000 7 년 전
부모
커밋
0ef96953c3
1개의 변경된 파일13개의 추가작업 그리고 6개의 파일을 삭제
  1. 13 6
      UI/window-basic-main.cpp

+ 13 - 6
UI/window-basic-main.cpp

@@ -5156,15 +5156,22 @@ void OBSBasic::AutoRemux()
 		? config_get_string(basicConfig, "SimpleOutput", "FilePath")
 		: config_get_string(basicConfig, "AdvOut", "RecFilePath");
 
-	std::string s(path);
-	s += "/";
-	s += remuxFilename;
-	const QString &str = QString::fromStdString(s);
-	QString file = str.section(".", 0, 0);
+	QString input;
+	input += path;
+	input += "/";
+	input += remuxFilename.c_str();
+
+	QFileInfo fi(remuxFilename.c_str());
+
+	QString output;
+	output += path;
+	output += "/";
+	output += fi.completeBaseName();
+	output += ".mp4";
 
 	OBSRemux *remux = new OBSRemux(path, this, true);
 	remux->show();
-	remux->AutoRemux(str, file + ".mp4");
+	remux->AutoRemux(input, output);
 }
 
 void OBSBasic::StartRecording()