mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
pt import: Fix race condition/threading, don't call new_audio_track() in bg thread
This commit is contained in:
parent
a307cc602c
commit
12d62cd16e
3 changed files with 66 additions and 52 deletions
|
|
@ -97,19 +97,21 @@ Editor::external_pt_dialog ()
|
|||
|
||||
ipw.show();
|
||||
|
||||
while (!import_pt_status.all_done) {
|
||||
while (!import_pt_status.all_done && !import_pt_status.cancel) {
|
||||
gtk_main_iteration ();
|
||||
}
|
||||
|
||||
// wait for thread to terminate
|
||||
while (!import_pt_status.done) {
|
||||
while (!import_pt_status.done && !import_pt_status.cancel) {
|
||||
gtk_main_iteration ();
|
||||
}
|
||||
|
||||
if (import_pt_status.cancel) {
|
||||
MessageDialog msg (_("PT import may have missing files, check session log for details"));
|
||||
MessageDialog msg (_("PT import cancelled"));
|
||||
msg.run ();
|
||||
} else {
|
||||
_session->import_pt_rest (import_ptf);
|
||||
import_pt_status.progress = 1.0;
|
||||
MessageDialog msg (_("PT import complete!"));
|
||||
msg.run ();
|
||||
}
|
||||
|
|
@ -118,7 +120,7 @@ Editor::external_pt_dialog ()
|
|||
void *
|
||||
Editor::_import_pt_thread (void *arg)
|
||||
{
|
||||
SessionEvent::create_per_thread_pool ("import pt events", 2048);
|
||||
SessionEvent::create_per_thread_pool ("import pt events", 64);
|
||||
|
||||
Editor *ed = (Editor *) arg;
|
||||
return ed->import_pt_thread ();
|
||||
|
|
@ -127,6 +129,6 @@ Editor::_import_pt_thread (void *arg)
|
|||
void *
|
||||
Editor::import_pt_thread ()
|
||||
{
|
||||
_session->import_pt (import_ptf, import_pt_status);
|
||||
_session->import_pt_sources (import_ptf, import_pt_status);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue