diff options
author | GZharun <grygoriiz@wavesglobal.com> | 2015-05-12 17:50:26 +0300 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-06-29 14:18:12 -0400 |
commit | 939e7c2d526de66b080f2018d422b0ea5a569d78 (patch) | |
tree | fb7d395692e79a11971e014463e2200677012121 | |
parent | 8505c16057a074531a99728e730408151d7aafa4 (diff) |
Fixed f65026f0a1cbc64862a82109c28f5d493fc45f2e merged commit related to waves backend
[Reviewed] PDavis
-rw-r--r-- | libs/backends/wavesaudio/waves_audiobackend.cc | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libs/backends/wavesaudio/waves_audiobackend.cc b/libs/backends/wavesaudio/waves_audiobackend.cc index fa3a7c8c95..5a8fac0a6a 100644 --- a/libs/backends/wavesaudio/waves_audiobackend.cc +++ b/libs/backends/wavesaudio/waves_audiobackend.cc @@ -738,11 +738,6 @@ WavesAudioBackend::_audio_device_callback (const float* input_buffer, // COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesAudioBackend::_audio_device_callback ():" << _device->DeviceName () << std::endl; _sample_time_at_cycle_start = sample_time; _cycle_start_time_nanos = cycle_start_time_nanos; - - /* There is the possibility that the thread this runs in may change from - * callback to callback, so do it every time. - */ - _main_thread = pthread_self (); if (_buffer_size != nframes) { // COMMENTED DBG LOGS */ std::cout << "\tAudioEngine::thread_init_callback() buffer size and nframes are not equal: " << _buffer_size << "!=" << nframes << std::endl; @@ -755,19 +750,25 @@ WavesAudioBackend::_audio_device_callback (const float* input_buffer, if (_call_thread_init_callback) { _call_thread_init_callback = false; // COMMENTED DBG LOGS */ std::cout << "\tAudioEngine::thread_init_callback() invoked for " << std::hex << pthread_self() << std::dec << " !" << std::endl; + + /* There is the possibility that the thread this runs in may change from + * callback to callback, so do it every time. + */ + _main_thread = pthread_self (); + AudioEngine::thread_init_callback (this); } if ( !engine.thread_initialised_for_audio_processing () ) { std::cerr << "\tWavesAudioBackend::_audio_device_callback (): It's an attempt to call process callback from the thread which didn't initialize it " << std::endl; - if (process_id != pthread_self() ) { - std::cerr << "Process thread ID has changed. Expected thread: " << process_id << " current thread: " << pthread_self() << std::dec << " !" << std::endl; - process_id = pthread_self(); - } - AudioEngine::thread_init_callback (this); } + + if (_main_thread != pthread_self() ) { + std::cerr << "Process thread ID has changed. Expected thread: " << process_id << " current thread: " << pthread_self() << std::dec << " !" << std::endl; + _main_thread = pthread_self(); + } engine.process_callback (nframes); |