From c6b97612ae43df322ab88218a1a6d86062475ee7 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 30 Nov 2011 00:40:22 +0000 Subject: [PATCH] Delay creation of the audio renderer until audio is actually opened Originally committed to SVN as r5940. --- aegisub/src/audio_display.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aegisub/src/audio_display.cpp b/aegisub/src/audio_display.cpp index f3be81f32..fce16d4b1 100644 --- a/aegisub/src/audio_display.cpp +++ b/aegisub/src/audio_display.cpp @@ -565,8 +565,6 @@ AudioDisplay::AudioDisplay(wxWindow *parent, AudioController *controller, agi::C audio_renderer->SetAmplitudeScale(scale_amplitude); SetZoomLevel(0); - ReloadRenderingSettings(); - SetMinClientSize(wxSize(-1, 70)); SetBackgroundStyle(wxBG_STYLE_PAINT); SetThemeEnabled(false); @@ -1172,9 +1170,12 @@ void AudioDisplay::OnFocus(wxFocusEvent &event) } -void AudioDisplay::OnAudioOpen(AudioProvider *_provider) +void AudioDisplay::OnAudioOpen(AudioProvider *provider) { - provider = _provider; + this->provider = provider; + + if (!audio_renderer_provider) + ReloadRenderingSettings(); audio_renderer->SetAudioProvider(provider); audio_renderer->SetCacheMaxSize(OPT_GET("Audio/Renderer/Spectrum/Memory Max")->GetInt() * 1024 * 1024);