From 2163f9c4408ec41cf37349f2a96b6a134e97d893 Mon Sep 17 00:00:00 2001 From: halx99 Date: Fri, 31 Jul 2020 16:36:45 +0800 Subject: [PATCH] Add missing detect macro CC_USE_ALSOFT_ON_APPLE on apple platform --- cocos/audio/include/AudioEngineImpl.h | 2 +- cocos/audio/include/AudioPlayer.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/audio/include/AudioEngineImpl.h b/cocos/audio/include/AudioEngineImpl.h index bfbc82b3ad..19df448899 100644 --- a/cocos/audio/include/AudioEngineImpl.h +++ b/cocos/audio/include/AudioEngineImpl.h @@ -68,7 +68,7 @@ private: void _updateLocked(float dt); void _play2d(AudioCache *cache, AUDIO_ID audioID); ALuint findValidSource(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) && !CC_USE_ALSOFT_ON_APPLE static ALvoid myAlSourceNotificationCallback(ALuint sid, ALuint notificationID, ALvoid* userData); #endif ALuint _alSources[MAX_AUDIOINSTANCES]; diff --git a/cocos/audio/include/AudioPlayer.h b/cocos/audio/include/AudioPlayer.h index b9652b5a99..df3df26d4f 100644 --- a/cocos/audio/include/AudioPlayer.h +++ b/cocos/audio/include/AudioPlayer.h @@ -60,7 +60,7 @@ protected: void setCache(AudioCache* cache); void rotateBufferThread(int offsetFrame); bool play2d(); -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) && !CC_USE_ALSOFT_ON_APPLE void wakeupRotateThread(); #endif @@ -84,7 +84,7 @@ protected: std::mutex _sleepMutex; bool _timeDirty; bool _isRotateThreadExited; -#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) && !CC_USE_ALSOFT_ON_APPLE std::atomic_bool _needWakeupRotateThread; #endif