Timeline: Fix diskstream flushing/shutdown.

This commit is contained in:
Jonathan Moore Liles 2013-09-06 19:12:40 -07:00
parent 3ca72b4ac6
commit 963d926659
5 changed files with 10 additions and 4 deletions

View File

@ -77,8 +77,6 @@ Disk_Stream::~Disk_Stream ( )
// timeline->wrlock(); // timeline->wrlock();
shutdown();
_track = NULL; _track = NULL;
sem_destroy( &_blocks ); sem_destroy( &_blocks );
@ -134,7 +132,7 @@ Disk_Stream::shutdown ( void )
while ( _terminate ) while ( _terminate )
{ {
block_processed(); block_processed();
usleep( 1000 ); usleep( 10 * 1000 );
} }
_thread.join(); _thread.join();

View File

@ -183,6 +183,8 @@ done:
free(buf); free(buf);
free(cbuf); free(cbuf);
// flush();
_terminate = false; _terminate = false;
_thread.exit(); _thread.exit();

View File

@ -39,6 +39,8 @@ public:
run(); run();
} }
virtual ~Playback_DS ( ) { shutdown(); }
bool seek_pending ( void ); bool seek_pending ( void );
void seek ( nframes_t frame ); void seek ( nframes_t frame );
nframes_t process ( nframes_t nframes ); nframes_t process ( nframes_t nframes );

View File

@ -152,6 +152,8 @@ Record_DS::disk_thread ( void )
delete c; delete c;
flush();
_terminate = false; _terminate = false;
DMESSAGE( "capture thread gone" ); DMESSAGE( "capture thread gone" );

View File

@ -44,7 +44,7 @@ class Record_DS : public Disk_Stream
void write_block ( sample_t *buf, nframes_t nframes ); void write_block ( sample_t *buf, nframes_t nframes );
void disk_thread ( void ); void disk_thread ( void );
void flush ( void ) { base_flush( false ); } virtual void flush ( void ) { base_flush( false ); }
public: public:
@ -60,6 +60,8 @@ public:
_frames_written = 0; _frames_written = 0;
} }
virtual ~Record_DS ( ) { shutdown(); }
/* bool seek_pending ( void ); */ /* bool seek_pending ( void ); */
/* void seek ( nframes_t frame ); */ /* void seek ( nframes_t frame ); */
const Audio_Region * capture_region ( void ) const; const Audio_Region * capture_region ( void ) const;