diff options
author | Liang Qi <liang.qi@qt.io> | 2019-04-10 12:42:28 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-04-10 12:42:28 +0200 |
commit | 82fdc8913483dd352ae2c326dd358fe9ff8f3f66 (patch) | |
tree | 5bc321569aa2ba0821a04b0b439edd549ded6512 /src/plugins/windowsaudio | |
parent | f787689e74dee63c55f2731683a4ede752fd9e44 (diff) | |
parent | c8716f68feb5a38473cbd54972b9a9f095e9e24d (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
tests/auto/integration/qdeclarativevideooutput/tst_qdeclarativevideooutput.cpp
Done-with: Val Doroshchuk <valentyn.doroshchuk@qt.io>
Change-Id: I745dd948c1e98180115f85c17bef802351bbdb6b
Diffstat (limited to 'src/plugins/windowsaudio')
-rw-r--r-- | src/plugins/windowsaudio/qwindowsaudioinput.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/windowsaudio/qwindowsaudioinput.cpp b/src/plugins/windowsaudio/qwindowsaudioinput.cpp index 00b36cfe4..717baaff0 100644 --- a/src/plugins/windowsaudio/qwindowsaudioinput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudioinput.cpp @@ -74,7 +74,7 @@ QWindowsAudioInput::QWindowsAudioInput(const QByteArray &device) waveBlockOffset = 0; mixerID = 0; - cachedVolume = 1.0f; + cachedVolume = -1.0f; memset(&mixerLineControls, 0, sizeof(mixerLineControls)); } @@ -228,7 +228,7 @@ qreal QWindowsAudioInput::volume() const return detailsUnsigned.dwValue / 65535.0; } - return cachedVolume; + return qFuzzyCompare(cachedVolume, qreal(-1.0f)) ? 1.0f : cachedVolume; } void QWindowsAudioInput::setFormat(const QAudioFormat& fmt) @@ -429,7 +429,7 @@ void QWindowsAudioInput::initMixer() mixerLineControls.pamxctrl = new MIXERCONTROL[mixerLineControls.cControls]; if (mixerGetLineControls(mixerID, &mixerLineControls, MIXER_GETLINECONTROLSF_ALL) != MMSYSERR_NOERROR) closeMixer(); - else + else if (!qFuzzyCompare(cachedVolume, qreal(-1.0f))) setVolume(cachedVolume); } } |