Mipmap peak building actually happens in the UI thread, not the IO thread.
Therefore, it is always necessary to fork when mipmapping peaks after capture.
This commit is contained in:
parent
33c646109f
commit
232d23915a
|
@ -209,7 +209,6 @@ Audio_Region::write ( nframes_t nframes )
|
|||
return nframes;
|
||||
}
|
||||
|
||||
/* THREAD: IO */
|
||||
/** finalize region capture. Assumes that this *is* a captured region
|
||||
and that no other regions refer to the same source */
|
||||
bool
|
||||
|
|
|
@ -135,6 +135,7 @@ Disk_Stream::shutdown ( void )
|
|||
pthread_join( _thread, NULL );
|
||||
|
||||
_thread = 0;
|
||||
|
||||
_terminate = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -530,7 +530,6 @@ Peaks::prepare_for_writing ( void )
|
|||
_peak_writer = new Peaks::Streamer( _clip->name(), _clip->channels(), cache_minimum );
|
||||
}
|
||||
|
||||
/* THREAD: IO */
|
||||
void
|
||||
Peaks::finish_writing ( void )
|
||||
{
|
||||
|
@ -539,10 +538,9 @@ Peaks::finish_writing ( void )
|
|||
delete _peak_writer;
|
||||
_peak_writer = NULL;
|
||||
|
||||
/* now fill in the rest of the cache */
|
||||
make_peaks_mipmap();
|
||||
/* if ( ! fork() ) */
|
||||
/* exit( make_peaks_mipmap() ); */
|
||||
/* now fill in the rest of the cache */
|
||||
if ( ! fork() )
|
||||
exit( make_peaks_mipmap() );
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -145,12 +145,11 @@ Record_DS::disk_thread ( void )
|
|||
const nframes_t nframes = _nframes;
|
||||
const size_t block_size = _nframes * sizeof( sample_t );
|
||||
|
||||
|
||||
#ifdef AVOID_UNNECESSARY_COPYING
|
||||
sample_t *cbuf = new sample_t[ nframes ];
|
||||
#endif
|
||||
|
||||
while ( blocks_ready-- > 0 || ! sem_trywait( &_blocks ) && errno != EAGAIN )
|
||||
while ( blocks_ready-- > 0 || ( ! sem_trywait( &_blocks ) && errno != EAGAIN ) )
|
||||
{
|
||||
|
||||
for ( int i = channels(); i--; )
|
||||
|
@ -182,8 +181,6 @@ Record_DS::disk_thread ( void )
|
|||
#ifndef AVOID_UNNECESSARY_COPYING
|
||||
delete[] cbuf;
|
||||
#endif
|
||||
|
||||
_thread = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -217,21 +214,16 @@ Record_DS::stop ( nframes_t frame )
|
|||
{
|
||||
if ( ! _recording )
|
||||
{
|
||||
printf( "programming error: attempt to stop recording when no recording is being made\n" );
|
||||
WARNING( "programming error: attempt to stop recording when no recording is being made\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
_recording = false;
|
||||
|
||||
/* FIXME: we may still have data in the buffers waiting to be
|
||||
* written to disk... We should flush it out before stopping... */
|
||||
|
||||
_stop_frame = frame;
|
||||
|
||||
shutdown();
|
||||
|
||||
/* FIXME: flush buffers here? */
|
||||
|
||||
track()->stop( frame );
|
||||
|
||||
DMESSAGE( "recording finished" );
|
||||
|
|
Loading…
Reference in New Issue