Fix port-connection callbacks on engine restart
When the engine is restarted, ports are re-established,
and previously queued port-connections need to be cleared.
This caused a bug:
* when the engine is stopped all ports are disconnected.
_port_connection_queue contains all disconnections
* engine is stopped so _port_connection_queue is not processed
* engine-restart re-etablishes ports and appends those connections
to _port_connection_queue
* process-callback processes the list in **reverse** order
```
while (!_port_connection_queue.empty ()) {
_port_connection_queue.pop_back ();
}
```
* ARDOUR::PortManager::connect_callback() is first called
with connected() and the disconnected()
* All ports are assumed to not be connected
Port::_externally_connected == 0 for all ports
Result:
* vari-speed playback resampling does not work (only external
I/O is reampled), split cycles processing (looping) fails
since AudioPort::get_audio_buffer() does not apply the
_global_port_buffer_offset
This commit is contained in:
@@ -435,6 +435,10 @@ PortEngineSharedImpl::clear_ports ()
|
||||
_ports.flush ();
|
||||
_portmap.flush ();
|
||||
|
||||
pthread_mutex_lock (&_port_callback_mutex);
|
||||
_port_change_flag = false;
|
||||
_port_connection_queue.clear();
|
||||
pthread_mutex_unlock (&_port_callback_mutex);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
||||
Reference in New Issue
Block a user