use shared ptr for audio device
Prevents deletion before audio output has received stop signal
This commit is contained in:
@@ -35,10 +35,9 @@ void AudioOutputDeviceProxy::SetParameters(const AudioParams ¶ms)
|
||||
params_ = params;
|
||||
}
|
||||
|
||||
void AudioOutputDeviceProxy::SetDevice(QIODevice* device, int playback_speed)
|
||||
void AudioOutputDeviceProxy::SetDevice(std::shared_ptr<QIODevice> device, int playback_speed)
|
||||
{
|
||||
device_ = device;
|
||||
device_->setParent(this);
|
||||
|
||||
if (!device_->open(QFile::ReadOnly)) {
|
||||
qCritical() << "Failed to open IO device for audio playback";
|
||||
|
||||
Reference in New Issue
Block a user