Don't initialize volume on pulse audio input by default.
Task-number: QTBUG-49461 Change-Id: I32b707e19091ab8344175b2dc0cdd1747f1186b3 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
c106041bd6
commit
4a2c597a06
@@ -150,6 +150,7 @@ QPulseAudioInput::QPulseAudioInput(const QByteArray &device)
|
|||||||
, m_errorState(QAudio::NoError)
|
, m_errorState(QAudio::NoError)
|
||||||
, m_deviceState(QAudio::StoppedState)
|
, m_deviceState(QAudio::StoppedState)
|
||||||
, m_volume(qreal(1.0f))
|
, m_volume(qreal(1.0f))
|
||||||
|
, m_customVolumeRequired(false)
|
||||||
, m_pullMode(true)
|
, m_pullMode(true)
|
||||||
, m_opened(false)
|
, m_opened(false)
|
||||||
, m_bytesAvailable(0)
|
, m_bytesAvailable(0)
|
||||||
@@ -355,7 +356,8 @@ bool QPulseAudioInput::open()
|
|||||||
if (actualBufferAttr->tlength != (uint32_t)-1)
|
if (actualBufferAttr->tlength != (uint32_t)-1)
|
||||||
m_bufferSize = actualBufferAttr->tlength;
|
m_bufferSize = actualBufferAttr->tlength;
|
||||||
|
|
||||||
setPulseVolume();
|
if (m_customVolumeRequired)
|
||||||
|
setPulseVolume();
|
||||||
|
|
||||||
pulseEngine->unlock();
|
pulseEngine->unlock();
|
||||||
|
|
||||||
@@ -568,6 +570,7 @@ void QPulseAudioInput::setVolume(qreal vol)
|
|||||||
if (vol >= 0.0 && vol <= 1.0) {
|
if (vol >= 0.0 && vol <= 1.0) {
|
||||||
QPulseAudioEngine *pulseEngine = QPulseAudioEngine::instance();
|
QPulseAudioEngine *pulseEngine = QPulseAudioEngine::instance();
|
||||||
pulseEngine->lock();
|
pulseEngine->lock();
|
||||||
|
m_customVolumeRequired = true;
|
||||||
if (!qFuzzyCompare(m_volume, vol)) {
|
if (!qFuzzyCompare(m_volume, vol)) {
|
||||||
m_volume = vol;
|
m_volume = vol;
|
||||||
if (m_opened) {
|
if (m_opened) {
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public:
|
|||||||
QAudio::Error m_errorState;
|
QAudio::Error m_errorState;
|
||||||
QAudio::State m_deviceState;
|
QAudio::State m_deviceState;
|
||||||
qreal m_volume;
|
qreal m_volume;
|
||||||
|
bool m_customVolumeRequired;
|
||||||
pa_cvolume m_chVolume;
|
pa_cvolume m_chVolume;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user