use shared ptr for audio device
Prevents deletion before audio output has received stop signal
This commit is contained in:
@@ -94,7 +94,7 @@ void AudioManager::PushToOutput(const QByteArray &samples)
|
||||
emit OutputPushed(samples);
|
||||
}
|
||||
|
||||
void AudioManager::StartOutput(QIODevice *device, int playback_speed)
|
||||
void AudioManager::StartOutput(std::shared_ptr<QIODevice> device, int playback_speed)
|
||||
{
|
||||
// Move to output manager's thread
|
||||
device->moveToThread(&output_thread_);
|
||||
@@ -103,7 +103,7 @@ void AudioManager::StartOutput(QIODevice *device, int playback_speed)
|
||||
QMetaObject::invokeMethod(output_manager_,
|
||||
"PullFromDevice",
|
||||
Qt::QueuedConnection,
|
||||
Q_ARG(QIODevice*, device),
|
||||
Q_ARG(std::shared_ptr<QIODevice>, device),
|
||||
Q_ARG(int, playback_speed));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user