Mixer & PlayHandle: Support PlayHandle without audioPort and set
audioPort as nullptr by default.
This commit is contained in:
@@ -451,7 +451,8 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
}
|
||||
if( ( *it )->isFinished() )
|
||||
{
|
||||
( *it )->audioPort()->removePlayHandle( ( *it ) );
|
||||
if (( *it )->audioPort())
|
||||
( *it )->audioPort()->removePlayHandle( ( *it ) );
|
||||
if( ( *it )->type() == PlayHandle::TypeNotePlayHandle )
|
||||
{
|
||||
NotePlayHandleManager::release( (NotePlayHandle*) *it );
|
||||
@@ -653,7 +654,8 @@ bool Mixer::addPlayHandle( PlayHandle* handle )
|
||||
if( criticalXRuns() == false )
|
||||
{
|
||||
m_newPlayHandles.push( handle );
|
||||
handle->audioPort()->addPlayHandle( handle );
|
||||
if (handle->audioPort())
|
||||
handle->audioPort()->addPlayHandle( handle );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -675,7 +677,8 @@ void Mixer::removePlayHandle( PlayHandle * _ph )
|
||||
if( _ph->affinityMatters() &&
|
||||
_ph->affinity() == QThread::currentThread() )
|
||||
{
|
||||
_ph->audioPort()->removePlayHandle( _ph );
|
||||
if (_ph->audioPort())
|
||||
_ph->audioPort()->removePlayHandle( _ph );
|
||||
bool removedFromList = false;
|
||||
// Check m_newPlayHandles first because doing it the other way around
|
||||
// creates a race condition
|
||||
@@ -735,7 +738,8 @@ void Mixer::removePlayHandlesOfTypes( Track * _track, const quint8 types )
|
||||
{
|
||||
if( ( *it )->isFromTrack( _track ) && ( ( *it )->type() & types ) )
|
||||
{
|
||||
( *it )->audioPort()->removePlayHandle( ( *it ) );
|
||||
if (( *it )->audioPort())
|
||||
( *it )->audioPort()->removePlayHandle( ( *it ) );
|
||||
if( ( *it )->type() == PlayHandle::TypeNotePlayHandle )
|
||||
{
|
||||
NotePlayHandleManager::release( (NotePlayHandle*) *it );
|
||||
|
||||
@@ -38,7 +38,8 @@ PlayHandle::PlayHandle(const Type type, f_cnt_t offset) :
|
||||
m_affinity(QThread::currentThread()),
|
||||
m_playHandleBuffer(BufferManager::acquire()),
|
||||
m_bufferReleased(true),
|
||||
m_usesBuffer(true)
|
||||
m_usesBuffer(true),
|
||||
m_audioPort{nullptr}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user