default to override extension if mov

fixes #1075
pull/1089/head
Mikael Finstad 2022-03-18 15:40:08 +08:00
rodzic f8ce5614a3
commit f3738fab91
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 25AB36E3E81CBC26
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -168,7 +168,16 @@ export function getExtensionForFormat(format) {
}
export function getOutFileExtension({ isCustomFormatSelected, outFormat, filePath }) {
return isCustomFormatSelected ? `.${getExtensionForFormat(outFormat)}` : extname(filePath);
if (!isCustomFormatSelected) {
const ext = extname(filePath);
// QuickTime is quirky about the file extension of mov files (has to be .mov)
// https://github.com/mifi/lossless-cut/issues/1075#issuecomment-1072084286
const hasMovIncorrectExtension = outFormat === 'mov' && ext.toLowerCase() !== '.mov';
// OK, just keep the current extension. Because most players will not care about the extension
if (!hasMovIncorrectExtension) return extname(filePath);
}
return `.${getExtensionForFormat(outFormat)}`;
}
// This is used as a fallback and so it has to always generate unique file names