don't use fifoWriter when rendering as we do not have realtime issues here - fixes lockups on various systems when exporting project
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1122 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -96,7 +96,7 @@ fpp_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
// make sure, no other thread is accessing device
|
||||
lock();
|
||||
|
||||
// now were safe to access the device
|
||||
// resample if neccessary
|
||||
if( getMixer()->processingSampleRate() != m_sampleRate )
|
||||
{
|
||||
resample( b, frames, _ab, getMixer()->processingSampleRate(),
|
||||
@@ -112,7 +112,10 @@ fpp_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
// release lock
|
||||
unlock();
|
||||
|
||||
delete[] b;
|
||||
if( getMixer()->hasFifoWriter() )
|
||||
{
|
||||
delete[] b;
|
||||
}
|
||||
|
||||
return( frames );
|
||||
}
|
||||
@@ -122,9 +125,12 @@ fpp_t audioDevice::getNextBuffer( surroundSampleFrame * _ab )
|
||||
|
||||
void audioDevice::stopProcessing( void )
|
||||
{
|
||||
while( m_inProcess )
|
||||
if( getMixer()->hasFifoWriter() )
|
||||
{
|
||||
processNextBuffer();
|
||||
while( m_inProcess )
|
||||
{
|
||||
processNextBuffer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -344,10 +344,17 @@ void mixer::initDevices( void )
|
||||
|
||||
|
||||
|
||||
void mixer::startProcessing( void )
|
||||
void mixer::startProcessing( bool _needs_fifo )
|
||||
{
|
||||
m_fifo_writer = new fifoWriter( this, m_fifo );
|
||||
m_fifo_writer->start();
|
||||
if( _needs_fifo )
|
||||
{
|
||||
m_fifoWriter = new fifoWriter( this, m_fifo );
|
||||
m_fifoWriter->start();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fifoWriter = NULL;
|
||||
}
|
||||
|
||||
m_audioDev->startProcessing();
|
||||
}
|
||||
@@ -357,13 +364,19 @@ void mixer::startProcessing( void )
|
||||
|
||||
void mixer::stopProcessing( void )
|
||||
{
|
||||
m_fifo_writer->finish();
|
||||
|
||||
m_audioDev->stopProcessing();
|
||||
|
||||
m_fifo_writer->wait( 1000 );
|
||||
m_fifo_writer->terminate();
|
||||
delete m_fifo_writer;
|
||||
if( m_fifoWriter != NULL )
|
||||
{
|
||||
m_fifoWriter->finish();
|
||||
m_audioDev->stopProcessing();
|
||||
m_fifoWriter->wait( 1000 );
|
||||
m_fifoWriter->terminate();
|
||||
delete m_fifoWriter;
|
||||
m_fifoWriter = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_audioDev->stopProcessing();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -825,7 +838,8 @@ void mixer::setAudioDevice( audioDevice * _dev )
|
||||
|
||||
|
||||
void mixer::setAudioDevice( audioDevice * _dev,
|
||||
const struct qualitySettings & _qs )
|
||||
const struct qualitySettings & _qs,
|
||||
bool _needs_fifo )
|
||||
{
|
||||
// don't delete the audio-device
|
||||
stopProcessing();
|
||||
@@ -847,7 +861,7 @@ void mixer::setAudioDevice( audioDevice * _dev,
|
||||
emit qualitySettingsChanged();
|
||||
emit sampleRateChanged();
|
||||
|
||||
startProcessing();
|
||||
startProcessing( _needs_fifo );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ void projectRenderer::startProcessing( void )
|
||||
// have to do mixer stuff with GUI-thread-affinity in order to make
|
||||
// slots connected to sampleRateChanged()-signals being called
|
||||
// immediately
|
||||
engine::getMixer()->setAudioDevice( m_fileDev, m_qualitySettings );
|
||||
engine::getMixer()->setAudioDevice( m_fileDev, m_qualitySettings,
|
||||
FALSE );
|
||||
|
||||
start( QThread::HighestPriority );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user