1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Bug 2178 - Export to (external program) fails with errors [WINDOWS]

This fixes the problem on Windows that if a user does not specify a suffix then
ffmpeg does not know what format to use and gives a cryptic error message,
if exporting using

ffmpeg -i - "filename"

Now, if no suffix is given, .wav is appended in the command sent to ffmpeg.
If a user gives a suffix, e.g. 'myfile.wma' then no suffix is added.
This commit is contained in:
James Crook 2019-07-28 15:57:48 +01:00
parent 29b0e31ee6
commit 2b15aa28ca

View File

@ -107,6 +107,7 @@ void ExportCLOptions::PopulateOrExchange(ShuttleGui & S)
wxString cmd;
for (size_t i = 0; i < mHistory.GetCount(); i++) {
cmd = mHistory.GetHistoryFile(i);
cmds.push_back(mHistory.GetHistoryFile(i));
}
cmd = cmds[0];
@ -332,6 +333,11 @@ ProgressResult ExportCL::Export(AudacityProject *project,
// Retrieve settings
gPrefs->Read(wxT("/FileFormats/ExternalProgramShowOutput"), &show, false);
cmd = gPrefs->Read(wxT("/FileFormats/ExternalProgramExportCommand"), wxT("lame - \"%f.mp3\""));
// Bug 2178 - users who don't know what they are doing will
// now get a file extension of .wav appended to their ffmpeg filename
// and therefore ffmpeg will be able to choose a file type.
if( cmd == wxT("ffmpeg -i - \"%f\"") && fName.Index( '.' )==wxNOT_FOUND)
cmd.Replace( "%f", "%f.wav" );
cmd.Replace(wxT("%f"), fName);
#if defined(__WXMSW__)