This commit is contained in:
halx99 2019-11-26 10:21:21 +08:00
parent 8546d4d7e1
commit bf807f8969
4 changed files with 16 additions and 20 deletions

View File

@ -233,7 +233,7 @@ void AudioEngineImpl::setVolume(AUDIO_ID audioID,float volume)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %d, error = %x", __FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __FUNCTION__,audioID,error);
}
}
}
@ -254,7 +254,7 @@ void AudioEngineImpl::setLoop(AUDIO_ID audioID, bool loop)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %d, error = %x", __FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __FUNCTION__,audioID,error);
}
}
}
@ -271,7 +271,7 @@ bool AudioEngineImpl::pause(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ret = false;
ALOGE("%s: audio id = %d, error = %x\n", __FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x\n", __FUNCTION__,audioID,error);
}
return ret;
@ -285,7 +285,7 @@ bool AudioEngineImpl::resume(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ret = false;
ALOGE("%s: audio id = %d, error = %x\n", __FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x\n", __FUNCTION__,audioID,error);
}
return ret;
@ -342,7 +342,7 @@ float AudioEngineImpl::getCurrentTime(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s, audio id:%d,error code:%x", __FUNCTION__,audioID,error);
ALOGE("%s, audio id:" AUDIO_ID_PRID ",error code:%x", __FUNCTION__,audioID,error);
}
}
}
@ -367,7 +367,7 @@ bool AudioEngineImpl::setCurrentTime(AUDIO_ID audioID, float time)
else {
if (player->_audioCache->_framesRead != player->_audioCache->_totalFrames &&
(time * player->_audioCache->_sampleRate) > player->_audioCache->_framesRead) {
ALOGE("%s: audio id = %d", __FUNCTION__,audioID);
ALOGE("%s: audio id = " AUDIO_ID_PRID, __FUNCTION__,audioID);
break;
}
@ -375,7 +375,7 @@ bool AudioEngineImpl::setCurrentTime(AUDIO_ID audioID, float time)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %d, error = %x", __FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __FUNCTION__,audioID,error);
}
ret = true;
}

View File

@ -503,7 +503,7 @@ void AudioEngineImpl::setVolume(AUDIO_ID audioID,float volume)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %zu, error = %x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __PRETTY_FUNCTION__,audioID,error);
}
}
}
@ -531,7 +531,7 @@ void AudioEngineImpl::setLoop(AUDIO_ID audioID, bool loop)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %zu, error = %x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __PRETTY_FUNCTION__,audioID,error);
}
}
}
@ -557,7 +557,7 @@ bool AudioEngineImpl::pause(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ret = false;
ALOGE("%s: audio id = %zu, error = %x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __PRETTY_FUNCTION__,audioID,error);
}
return ret;
@ -579,7 +579,7 @@ bool AudioEngineImpl::resume(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ret = false;
ALOGE("%s: audio id = %zu, error = %x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __PRETTY_FUNCTION__,audioID,error);
}
return ret;
@ -634,7 +634,7 @@ float AudioEngineImpl::getCurrentTime(AUDIO_ID audioID)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s, audio id:%zu,error code:%x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s, audio id:" AUDIO_ID_PRID ",error code:%x", __PRETTY_FUNCTION__,audioID,error);
}
}
}
@ -659,7 +659,7 @@ bool AudioEngineImpl::setCurrentTime(AUDIO_ID audioID, float time)
else {
if (player->_audioCache->_framesRead != player->_audioCache->_totalFrames &&
(time * player->_audioCache->_sampleRate) > player->_audioCache->_framesRead) {
ALOGE("%s: audio id = %zu", __PRETTY_FUNCTION__,audioID);
ALOGE("%s: audio id = " AUDIO_ID_PRID, __PRETTY_FUNCTION__,audioID);
break;
}
@ -667,7 +667,7 @@ bool AudioEngineImpl::setCurrentTime(AUDIO_ID audioID, float time)
auto error = alGetError();
if (error != AL_NO_ERROR) {
ALOGE("%s: audio id = %zu, error = %x", __PRETTY_FUNCTION__,audioID,error);
ALOGE("%s: audio id = " AUDIO_ID_PRID ", error = %x", __PRETTY_FUNCTION__,audioID,error);
}
ret = true;
}

View File

@ -27,6 +27,7 @@
#include "platform/CCPlatformConfig.h"
#include "platform/CCPlatformMacros.h"
#include "audio/include/AudioMacros.h"
#include "audio/include/Export.h"
#include <functional>
#include <list>
@ -37,10 +38,6 @@
#undef ERROR
#endif // ERROR
#if !defined(AUDIO_ID)
#define AUDIO_ID int
#endif
/**
* @addtogroup audio
* @{

View File

@ -82,6 +82,5 @@ do { \
break; \
}
#if !defined(AUDIO_ID)
#define AUDIO_ID int
#endif
#define AUDIO_ID_PRID "%d"