mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
coreaudio backend: switch threads early
This commit is contained in:
parent
fe85575a12
commit
c3d7654884
1 changed files with 6 additions and 7 deletions
|
|
@ -1558,6 +1558,12 @@ CoreAudioBackend::process_callback (const uint32_t n_samples, const uint64_t hos
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_reinit_thread_callback || _main_thread != pthread_self()) {
|
||||||
|
_reinit_thread_callback = false;
|
||||||
|
_main_thread = pthread_self();
|
||||||
|
AudioEngine::thread_init_callback (this);
|
||||||
|
}
|
||||||
|
|
||||||
if (pthread_mutex_trylock (&_process_callback_mutex)) {
|
if (pthread_mutex_trylock (&_process_callback_mutex)) {
|
||||||
// block while devices are added/removed
|
// block while devices are added/removed
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|
@ -1566,13 +1572,6 @@ CoreAudioBackend::process_callback (const uint32_t n_samples, const uint64_t hos
|
||||||
engine.Xrun();
|
engine.Xrun();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_reinit_thread_callback || _main_thread != pthread_self()) {
|
|
||||||
_reinit_thread_callback = false;
|
|
||||||
_main_thread = pthread_self();
|
|
||||||
AudioEngine::thread_init_callback (this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* port-connection change */
|
/* port-connection change */
|
||||||
pre_process();
|
pre_process();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue