Force correct extensions for export filenames.
authorCarl Hetherington <cth@carlh.net>
Tue, 29 Jan 2019 23:26:32 +0000 (23:26 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 29 Jan 2019 23:26:32 +0000 (23:26 +0000)
src/wx/export_dialog.cc

index 4661e54682dd2b6d25028c01e3923d0122bb8398..2223261d9ad0e5753a157c12339d7bc2025e261c 100644 (file)
@@ -38,6 +38,11 @@ wxString format_filters[] = {
        _("MP4 files (*.mp4)|*.mp4"),
 };
 
+wxString format_extensions[] = {
+       "mov",
+       "mp4"
+};
+
 FFmpegEncoder::Format formats[] = {
        FFmpegEncoder::FORMAT_PRORES,
        FFmpegEncoder::FORMAT_H264,
@@ -81,7 +86,9 @@ ExportDialog::format_changed ()
 boost::filesystem::path
 ExportDialog::path () const
 {
-       return wx_to_std (_file->GetPath ());
+       wxFileName fn (_file->GetPath());
+       fn.SetExt (format_extensions[_format->GetSelection()]);
+       return wx_to_std (fn.GetFullPath());
 }
 
 FFmpegEncoder::Format