diff --git a/Source/OBSCapture.cpp b/Source/OBSCapture.cpp index e1a51fa5..b9864435 100644 --- a/Source/OBSCapture.cpp +++ b/Source/OBSCapture.cpp @@ -445,7 +445,6 @@ retryHookTestV2: OSFindData ofd; HANDLE hFind = NULL; bool bUseDateTimeName = true; - bool bIsDirectory = true; bool bOverwrite = GlobalConfig->GetInt(L"General", L"OverwriteRecordings", false) != 0; if(!bOverwrite && (hFind = OSFindFirstFile(strOutputFile, ofd))) @@ -466,7 +465,6 @@ retryHookTestV2: strOutputFile = strNewFilePath; bUseDateTimeName = false; - bIsDirectory = false; } if(ofd.bDirectory) @@ -485,10 +483,11 @@ retryHookTestV2: GetLocalTime(&st); String strDirectory = GetPathDirectory(strOutputFile); + String file = strOutputFile.Right(strOutputFile.Length() - strDirectory.Length()); String extension; - if(!bIsDirectory) - extension = GetPathExtension(strOutputFile); + if (!file.IsEmpty()) + extension = GetPathExtension(file.Array()); if(extension.IsEmpty()) extension = TEXT("mp4");