mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
cleanup reinitialization of changed audio in/out
This commit is contained in:
parent
ad6e0a85f5
commit
32bc99fb38
|
@ -527,12 +527,6 @@ bool Audio::isInputReady()
|
|||
return alInDev;
|
||||
}
|
||||
|
||||
bool Audio::isInputSubscribed()
|
||||
{
|
||||
// No lock, inputSubscriptions is atomic!
|
||||
return inputSubscriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
Returns true if the output device is open
|
||||
*/
|
||||
|
|
|
@ -81,7 +81,6 @@ public:
|
|||
}
|
||||
|
||||
bool isInputReady();
|
||||
bool isInputSubscribed();
|
||||
bool isOutputReady();
|
||||
|
||||
static void createSource(ALuint* source);
|
||||
|
|
|
@ -335,21 +335,18 @@ void AVForm::onInDevChanged(QString deviceDescriptor)
|
|||
{
|
||||
if (!bodyUI->inDevCombobox->currentIndex())
|
||||
deviceDescriptor = "none";
|
||||
Settings::getInstance().setInDev(deviceDescriptor);
|
||||
|
||||
Audio& audio = Audio::getInstance();
|
||||
if (audio.isInputSubscribed())
|
||||
audio.openInput(deviceDescriptor);
|
||||
Settings::getInstance().setInDev(deviceDescriptor);
|
||||
Audio::getInstance().reinitInput(deviceDescriptor);
|
||||
}
|
||||
|
||||
void AVForm::onOutDevChanged(QString deviceDescriptor)
|
||||
{
|
||||
if (!bodyUI->outDevCombobox->currentIndex())
|
||||
deviceDescriptor = "none";
|
||||
Settings::getInstance().setOutDev(deviceDescriptor);
|
||||
|
||||
Audio& audio = Audio::getInstance();
|
||||
audio.openOutput(deviceDescriptor);
|
||||
Settings::getInstance().setOutDev(deviceDescriptor);
|
||||
Audio::getInstance().reinitOutput(deviceDescriptor);
|
||||
}
|
||||
|
||||
void AVForm::onFilterAudioToggled(bool filterAudio)
|
||||
|
|
Loading…
Reference in New Issue
Block a user