|
@@ -145,12 +145,11 @@ Record_DS::disk_thread ( void ) |
|
|
const nframes_t nframes = _nframes; |
|
|
const nframes_t nframes = _nframes; |
|
|
const size_t block_size = _nframes * sizeof( sample_t ); |
|
|
const size_t block_size = _nframes * sizeof( sample_t ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef AVOID_UNNECESSARY_COPYING |
|
|
#ifdef AVOID_UNNECESSARY_COPYING |
|
|
sample_t *cbuf = new sample_t[ nframes ]; |
|
|
sample_t *cbuf = new sample_t[ nframes ]; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
while ( blocks_ready-- > 0 || ! sem_trywait( &_blocks ) && errno != EAGAIN ) |
|
|
|
|
|
|
|
|
while ( blocks_ready-- > 0 || ( ! sem_trywait( &_blocks ) && errno != EAGAIN ) ) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
for ( int i = channels(); i--; ) |
|
|
for ( int i = channels(); i--; ) |
|
@@ -182,8 +181,6 @@ Record_DS::disk_thread ( void ) |
|
|
#ifndef AVOID_UNNECESSARY_COPYING |
|
|
#ifndef AVOID_UNNECESSARY_COPYING |
|
|
delete[] cbuf; |
|
|
delete[] cbuf; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
_thread = NULL; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -217,21 +214,16 @@ Record_DS::stop ( nframes_t frame ) |
|
|
{ |
|
|
{ |
|
|
if ( ! _recording ) |
|
|
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; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
_recording = false; |
|
|
_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; |
|
|
_stop_frame = frame; |
|
|
|
|
|
|
|
|
shutdown(); |
|
|
shutdown(); |
|
|
|
|
|
|
|
|
/* FIXME: flush buffers here? */ |
|
|
|
|
|
|
|
|
|
|
|
track()->stop( frame ); |
|
|
track()->stop( frame ); |
|
|
|
|
|
|
|
|
DMESSAGE( "recording finished" ); |
|
|
DMESSAGE( "recording finished" ); |
|
|