2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

added minimum system version to Info.plist, added suspended flag to OpenAL handle

This commit is contained in:
John Preston
2015-06-03 14:57:14 +03:00
parent db96605332
commit 16aafe28d5
3 changed files with 9 additions and 3 deletions

View File

@@ -450,7 +450,7 @@ AudioCapture *audioCapture() {
return capture;
}
AudioPlayerFader::AudioPlayerFader(QThread *thread) : _timer(this), _suspendFlag(false) {
AudioPlayerFader::AudioPlayerFader(QThread *thread) : _timer(this), _suspendFlag(false), _suspended(true) {
moveToThread(thread);
_timer.moveToThread(thread);
_suspendTimer.moveToThread(thread);
@@ -570,6 +570,7 @@ void AudioPlayerFader::onTimer() {
void AudioPlayerFader::onSuspendTimer() {
QMutexLocker lock(&_suspendMutex);
if (_suspendFlag) {
_suspended = true;
alcSuspendContext(audioContext);
}
}
@@ -582,7 +583,10 @@ void AudioPlayerFader::processContext() {
QMutexLocker lock(&_suspendMutex);
_suspendFlag = false;
emit stopSuspend();
alcProcessContext(audioContext);
if (_suspended) {
_suspended = false;
alcProcessContext(audioContext);
}
}
class AudioPlayerLoader {

View File

@@ -172,7 +172,7 @@ private:
QTimer _timer, _suspendTimer;
QMutex _suspendMutex;
bool _suspendFlag;
bool _suspendFlag, _suspended;
};