13
0

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.
This commit is contained in:
Tim Mayberry 2015-10-03 11:22:58 +10:00
parent 5ed05218e6
commit 3eb4b43fa6

View File

@ -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)