summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-06-29 00:05:19 +0100
committerCarl Hetherington <cth@carlh.net>2018-06-29 00:05:19 +0100
commit131acb2bc82e933c7adcd979ca23efa61e6311a8 (patch)
tree1d4d3ea46b958f4afc30428857413f53f8b056b8
parentf269467edad36b432e59ce3e5e3c87db28fdce40 (diff)
Prevent FFmpeg errors if export filenames are specified with no or incorrect extensions.
-rw-r--r--src/wx/export_dialog.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/wx/export_dialog.cc b/src/wx/export_dialog.cc
index 95814c518..87a824882 100644
--- a/src/wx/export_dialog.cc
+++ b/src/wx/export_dialog.cc
@@ -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