fix port-unregister (on failed latency measurement)
This commit is contained in:
parent
a0392a2349
commit
157161e482
@ -1110,11 +1110,13 @@ AudioEngine::start_latency_detection (bool for_midi)
|
||||
|
||||
const string portname ("latency_in");
|
||||
if ((_latency_input_port = pe.register_port (portname, DataType::MIDI, IsInput)) == 0) {
|
||||
pe.unregister_port (_latency_input_port);
|
||||
pe.unregister_port (_latency_output_port);
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
if (pe.connect (_latency_input_name, make_port_name_non_relative (portname))) {
|
||||
pe.unregister_port (_latency_input_port);
|
||||
pe.unregister_port (_latency_output_port);
|
||||
stop (true);
|
||||
return -1;
|
||||
@ -1136,11 +1138,13 @@ AudioEngine::start_latency_detection (bool for_midi)
|
||||
|
||||
const string portname ("latency_in");
|
||||
if ((_latency_input_port = pe.register_port (portname, DataType::AUDIO, IsInput)) == 0) {
|
||||
pe.unregister_port (_latency_input_port);
|
||||
pe.unregister_port (_latency_output_port);
|
||||
stop (true);
|
||||
return -1;
|
||||
}
|
||||
if (pe.connect (_latency_input_name, make_port_name_non_relative (portname))) {
|
||||
pe.unregister_port (_latency_input_port);
|
||||
pe.unregister_port (_latency_output_port);
|
||||
stop (true);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user