From 3eb4b43fa666c480b96a6f2dccc9bd766bcaa5e9 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 3 Oct 2015 11:22:58 +1000 Subject: Initialize AudioEngine::last_backend_error() to the default error string Currently the last backend error string is only set when calling AudioBackend::start. Errors that occur when calling other AudioBackend methods like AudioBackend::set_buffer_size do not set the last backend error string. So until all the required AudioBackend methods return an ErrorCode and last_backend_error() can be removed just set it to a default string. Until all errors that occur are correctly indicated by returning an error code there will still be situations where last_backend_error() is not indicative of the true error. For instance AudioEngine::start is called and it fails but returns a valid error code so last_backend_error() is set, then some other engine/backend method is called that fails and as last_backend_error is not set the GUI will display the incorrect error message. --- libs/ardour/audioengine.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/ardour/audioengine.cc') diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 3d0cfca523..69db73a6b7 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -87,6 +87,7 @@ AudioEngine::AudioEngine () , _stopped_for_latency (false) , _started_for_latency (false) , _in_destructor (false) + , _last_backend_error_string(AudioBackend::get_error_string((AudioBackend::ErrorCode)-1)) , _hw_reset_event_thread(0) , _hw_reset_request_count(0) , _stop_hw_reset_processing(0) -- cgit v1.2.3