13
0

Allow to disable input auto-connect when creating tracks

Auto-connect is handled in a background thread, so newly created
tracks are not immediately connected.

This causes a race-condition when fan-out directly disconnects
and re-connects ports after track/bus creation.
This commit is contained in:
Robin Gareus 2020-04-03 15:35:21 +02:00
parent 80f3b54be4
commit c16ab3a248
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 4 additions and 3 deletions

View File

@ -697,7 +697,8 @@ public:
uint32_t how_many, uint32_t how_many,
std::string name_template, std::string name_template,
PresentationInfo::order_t order, PresentationInfo::order_t order,
TrackMode mode = Normal TrackMode mode = Normal,
bool input_auto_connect = true
); );
std::list<boost::shared_ptr<MidiTrack> > new_midi_track ( std::list<boost::shared_ptr<MidiTrack> > new_midi_track (

View File

@ -2695,7 +2695,7 @@ Session::ensure_route_presentation_info_gap (PresentationInfo::order_t first_new
list< boost::shared_ptr<AudioTrack> > list< boost::shared_ptr<AudioTrack> >
Session::new_audio_track (int input_channels, int output_channels, RouteGroup* route_group, Session::new_audio_track (int input_channels, int output_channels, RouteGroup* route_group,
uint32_t how_many, string name_template, PresentationInfo::order_t order, uint32_t how_many, string name_template, PresentationInfo::order_t order,
TrackMode mode) TrackMode mode, bool input_auto_connect)
{ {
string track_name; string track_name;
uint32_t track_id = 0; uint32_t track_id = 0;
@ -2773,7 +2773,7 @@ Session::new_audio_track (int input_channels, int output_channels, RouteGroup* r
failed: failed:
if (!new_routes.empty()) { if (!new_routes.empty()) {
StateProtector sp (this); StateProtector sp (this);
add_routes (new_routes, true, true, false, order); add_routes (new_routes, input_auto_connect, true, false, order);
} }
return ret; return ret;