Strip filename inside of GetExpandedRecordingDirectoryBase

Fixes 'invalid' file name style paths like "C:/foo/%.flv"
This commit is contained in:
palana 2014-09-12 21:36:14 +02:00
parent f35e835758
commit 1802fd7ddc
2 changed files with 4 additions and 1 deletions

View File

@ -147,6 +147,9 @@ String ExpandRecordingFilename(String filename)
String GetExpandedRecordingDirectoryBase(String path) String GetExpandedRecordingDirectoryBase(String path)
{ {
if (GetPathExtension(path))
path = GetPathDirectory(path);
String expanded = path; String expanded = path;
do do
{ {

View File

@ -3339,7 +3339,7 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{ {
String path = OSGetDefaultVideoSavePath(); String path = OSGetDefaultVideoSavePath();
path = AppConfig->GetString(L"Publish", LOWORD(wParam) == ID_SAVEDREPLAYBUFFERS ? L"ReplayBufferSavePath" : L"SavePath", path.Array()); path = AppConfig->GetString(L"Publish", LOWORD(wParam) == ID_SAVEDREPLAYBUFFERS ? L"ReplayBufferSavePath" : L"SavePath", path.Array());
path = GetExpandedRecordingDirectoryBase(GetPathWithoutExtension(path)).FindReplace(L"/", L"\\"); path = GetExpandedRecordingDirectoryBase(path).FindReplace(L"/", L"\\");
String lastFile = App->lastOutputFile.FindReplace(L"/", L"\\"); String lastFile = App->lastOutputFile.FindReplace(L"/", L"\\");
LPITEMIDLIST item = nullptr; LPITEMIDLIST item = nullptr;