Timeline: Defer creation of audio file for recording until blocks are ready to be written.
This prevents unnecessary file creation in punch mode.
This commit is contained in:
parent
45a33b8467
commit
7770610d32
|
@ -60,6 +60,11 @@ Record_DS::write_block ( sample_t *buf, nframes_t nframes )
|
|||
if ( ! ( timeline && sequence() ) )
|
||||
return;
|
||||
|
||||
|
||||
if ( ! _capture->audio_file )
|
||||
/* create the file */
|
||||
track()->record( _capture, _frame );
|
||||
|
||||
track()->write( _capture, buf, nframes );
|
||||
|
||||
_frames_written += nframes;
|
||||
|
@ -72,8 +77,6 @@ Record_DS::disk_thread ( void )
|
|||
|
||||
DMESSAGE( "capture thread running..." );
|
||||
|
||||
track()->record( _capture, _frame );
|
||||
|
||||
const nframes_t nframes = _nframes;
|
||||
|
||||
/* buffer to hold the interleaved data returned by the track reader */
|
||||
|
@ -148,7 +151,8 @@ Record_DS::disk_thread ( void )
|
|||
|
||||
/* now finalize the recording */
|
||||
|
||||
track()->finalize( c, _stop_frame );
|
||||
if ( c->audio_file )
|
||||
track()->finalize( c, _stop_frame );
|
||||
|
||||
delete c;
|
||||
|
||||
|
|
Loading…
Reference in New Issue