From 155388b456a2f722ee3784a55fdd76e50298ea5a Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Fri, 4 Jul 2008 03:24:25 +0000 Subject: [PATCH] Add secret option to disable use of the PCM provider, mainly intended for debugging: "Audio Disable PCM Provider" (default is false ie. PCM provider enabled) Originally committed to SVN as r2232. --- aegisub/audio_provider.cpp | 12 +++++++----- aegisub/options.cpp | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/aegisub/audio_provider.cpp b/aegisub/audio_provider.cpp index 161848fde..5b1d53662 100644 --- a/aegisub/audio_provider.cpp +++ b/aegisub/audio_provider.cpp @@ -195,11 +195,13 @@ AudioProvider *AudioProviderFactoryManager::GetAudioProvider(wxString filename, // Prepare provider AudioProvider *provider = NULL; - // Try a PCM provider first - provider = CreatePCMAudioProvider(filename); - if (provider) { - if (provider->GetBytesPerSample() == 2 && provider->GetSampleRate() >= 32000) return provider; - return new ConvertAudioProvider(provider); + if (!Options.AsBool(_T("Audio Disable PCM Provider"))) { + // Try a PCM provider first + provider = CreatePCMAudioProvider(filename); + if (provider) { + if (provider->GetBytesPerSample() == 2 && provider->GetSampleRate() >= 32000) return provider; + return new ConvertAudioProvider(provider); + } } // List of providers diff --git a/aegisub/options.cpp b/aegisub/options.cpp index f466df28e..feecd3711 100644 --- a/aegisub/options.cpp +++ b/aegisub/options.cpp @@ -208,6 +208,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults,bool doOverride) { SetText(_T("Audio Alsa Device"), _T("default:0")); SetText(_T("Audio HD Cache Location"),_T("default"),1700); SetText(_T("Audio HD Cache Name"),_T("audio%02i.tmp"),1700); + SetBool(_T("Audio Disable PCM Provider"), false); // Technically these can do with just the spectrum object being re-created SetInt(_T("Audio Spectrum Cutoff"),0); SetInt(_T("Audio Spectrum Quality"),1);