From 16aafe28d5655327bc6700bd6b0fa8b669866c0a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 3 Jun 2015 14:57:14 +0300 Subject: [PATCH] added minimum system version to Info.plist, added suspended flag to OpenAL handle --- Telegram/SourceFiles/audio.cpp | 8 ++++++-- Telegram/SourceFiles/audio.h | 2 +- Telegram/Telegram.plist | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/audio.cpp b/Telegram/SourceFiles/audio.cpp index 3cf568e52..8afedfb91 100644 --- a/Telegram/SourceFiles/audio.cpp +++ b/Telegram/SourceFiles/audio.cpp @@ -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 { diff --git a/Telegram/SourceFiles/audio.h b/Telegram/SourceFiles/audio.h index ed9de8105..7d830eb63 100644 --- a/Telegram/SourceFiles/audio.h +++ b/Telegram/SourceFiles/audio.h @@ -172,7 +172,7 @@ private: QTimer _timer, _suspendTimer; QMutex _suspendMutex; - bool _suspendFlag; + bool _suspendFlag, _suspended; }; diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 2f82bdeb6..9c7aabc3a 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -12,6 +12,8 @@ APPL CFBundleShortVersionString 0.8.21 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) CFBundleSignature ???? CFBundleURLTypes