diff --git a/src/core/src/hydrogen.cpp b/src/core/src/hydrogen.cpp index 765c42af4..9bbc388a3 100644 --- a/src/core/src/hydrogen.cpp +++ b/src/core/src/hydrogen.cpp @@ -1269,10 +1269,15 @@ int audioEngine_process( uint32_t nframes, void* /*arg*/ ) * The "try_lock" was introduced for Bug #164 (Deadlock after during * alsa driver shutdown). The try_lock *should* only fail in rare circumstances * (like shutting down drivers). In such cases, it seems to be ok to interrupt - * audio processing. + * audio processing. Returning the special return value "2" enables the disk + * writer driver to repeat the processing of the current data. */ - if(!AudioEngine::get_instance()->try_lock( RIGHT_HERE )){ - return 2; + if(!AudioEngine::get_instance()->try_lock( RIGHT_HERE )) { + if ( m_pAudioDriver->class_name() == DiskWriterDriver::class_name() ) { + return 2; // inform the caller that we could not aquire the lock + } + + return 0; } if ( m_audioEngineState < STATE_READY) {