From cd2308e9ccc41914c7d782efd495d17aa070e660 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Mon, 23 Mar 2020 08:28:31 -0500 Subject: [PATCH] Don't crash with a fresh audacity.cfg --- src/export/ExportPCM.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 4074c1411..22a4b6e10 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -83,7 +83,8 @@ enum static int LoadOtherFormat(int def = 0) { - return gPrefs->Read(wxString::Format(wxT("/FileFormats/ExportFormat_SF1")), def); + return gPrefs->Read(wxString::Format(wxT("/FileFormats/ExportFormat_SF1")), + kFormats[0].format & SF_FORMAT_TYPEMASK); } static void SaveOtherFormat(int val) @@ -92,12 +93,11 @@ static void SaveOtherFormat(int val) gPrefs->Flush(); } -static int LoadEncoding(int type, int def = 0) +static int LoadEncoding(int type) { return gPrefs->Read(wxString::Format(wxT("/FileFormats/ExportFormat_SF1_Type/%s_%x"), - sf_header_shortname(type), type), def); + sf_header_shortname(type), type), (long int) 0); } - static void SaveEncoding(int type, int val) { gPrefs->Write(wxString::Format(wxT("/FileFormats/ExportFormat_SF1_Type/%s_%x"),