|
|
@@ -272,8 +272,14 @@ Track::record ( Capture *c, nframes_t frame ) |
|
|
|
/* open it again for reading in the GUI thread */ |
|
|
|
// Audio_File *af = Audio_File::from_file( c->audio_file->name() ); |
|
|
|
|
|
|
|
/* must acquire a write lock because the Audio_Region constructor |
|
|
|
* will add the region to the specified sequence */ |
|
|
|
timeline->wrlock(); |
|
|
|
|
|
|
|
c->region = new Audio_Region( c->audio_file, sequence(), frame ); |
|
|
|
|
|
|
|
timeline->unlock(); |
|
|
|
|
|
|
|
c->region->prepare(); |
|
|
|
} |
|
|
|
|
|
|
@@ -298,6 +304,8 @@ Track::finalize ( Capture *c, nframes_t frame ) |
|
|
|
/* adjust region start for latency */ |
|
|
|
/* FIXME: is just looking at the first channel good enough? */ |
|
|
|
|
|
|
|
timeline->wrlock(); |
|
|
|
|
|
|
|
DMESSAGE( "finalizing audio file" ); |
|
|
|
/* must finalize audio before peaks file, otherwise another thread |
|
|
|
* might think the peaks are out of date and attempt to regenerate |
|
|
@@ -323,5 +331,7 @@ Track::finalize ( Capture *c, nframes_t frame ) |
|
|
|
|
|
|
|
c->region->offset( capture_offset ); |
|
|
|
|
|
|
|
timeline->unlock(); |
|
|
|
|
|
|
|
// delete c->audio_file; |
|
|
|
} |