Merge pull request #10429 from zzmp/audio/close-device

Close audio device when switching outputs
This commit is contained in:
Zach Pomerantz 2017-05-18 17:18:53 -04:00 committed by GitHub
commit c5a0a1af2f
2 changed files with 1 additions and 1 deletions

View file

@ -1506,6 +1506,7 @@ bool AudioClient::switchOutputToAudioDevice(const QAudioDeviceInfo& outputDevice
// cleanup any previously initialized device
if (_audioOutput) {
_audioOutputIODevice.close();
_audioOutput->stop();
//must be deleted in next eventloop cycle when its called from notify()

View file

@ -94,7 +94,6 @@ public:
_audio(audio), _unfulfilledReads(0) {}
void start() { open(QIODevice::ReadOnly | QIODevice::Unbuffered); }
void stop() { close(); }
qint64 readData(char * data, qint64 maxSize) override;
qint64 writeData(const char * data, qint64 maxSize) override { return 0; }
int getRecentUnfulfilledReads() { int unfulfilledReads = _unfulfilledReads; _unfulfilledReads = 0; return unfulfilledReads; }