default to override extension if mov

fixes #1075
pull/1089/head
Mikael Finstad 4 years ago
parent f8ce5614a3
commit f3738fab91
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

@ -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

Loading…
Cancel
Save