diff options
-rw-r--r-- | include/media/AudioEffect.h | 12 | ||||
-rw-r--r-- | include/media/AudioRecord.h | 8 | ||||
-rw-r--r-- | include/media/AudioTrack.h | 12 | ||||
-rw-r--r-- | include/media/Visualizer.h | 4 | ||||
-rw-r--r-- | media/libmedia/AudioEffect.cpp | 8 | ||||
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 12 | ||||
-rw-r--r-- | media/libmedia/AudioSystem.cpp | 12 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 20 | ||||
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/IAudioFlingerClient.cpp | 2 | ||||
-rw-r--r-- | media/libmedia/ToneGenerator.cpp | 14 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 40 | ||||
-rw-r--r-- | services/audioflinger/AudioMixer.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/AudioPolicyService.cpp | 6 |
14 files changed, 78 insertions, 78 deletions
diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h index 1417416..7b0b443 100644 --- a/include/media/AudioEffect.h +++ b/include/media/AudioEffect.h @@ -226,8 +226,8 @@ public: AudioEffect(const effect_uuid_t *type, const effect_uuid_t *uuid = NULL, int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, + effect_callback_t cbf = NULL, + void* user = NULL, int sessionId = 0, audio_io_handle_t io = 0 ); @@ -238,8 +238,8 @@ public: AudioEffect(const char *typeStr, const char *uuidStr = NULL, int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, + effect_callback_t cbf = NULL, + void* user = NULL, int sessionId = 0, audio_io_handle_t io = 0 ); @@ -260,8 +260,8 @@ public: status_t set(const effect_uuid_t *type, const effect_uuid_t *uuid = NULL, int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, + effect_callback_t cbf = NULL, + void* user = NULL, int sessionId = 0, audio_io_handle_t io = 0 ); diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 76ec3b1..c8c5dba 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -155,8 +155,8 @@ public: uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, int frameCount = 0, uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, + callback_t cbf = NULL, + void* user = NULL, int notificationFrames = 0, int sessionId = 0); @@ -181,8 +181,8 @@ public: uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, int frameCount = 0, uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, + callback_t cbf = NULL, + void* user = NULL, int notificationFrames = 0, bool threadCanCallJava = false, int sessionId = 0); diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 98abfbd..02c85cd 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -148,8 +148,8 @@ public: int channelMask = 0, int frameCount = 0, uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, + callback_t cbf = NULL, + void* user = NULL, int notificationFrames = 0, int sessionId = 0); @@ -180,8 +180,8 @@ public: int channelMask = 0, const sp<IMemory>& sharedBuffer = 0, uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, + callback_t cbf = NULL, + void* user = NULL, int notificationFrames = 0, int sessionId = 0); @@ -204,8 +204,8 @@ public: int channelMask = 0, int frameCount = 0, uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, + callback_t cbf = NULL, + void* user = NULL, int notificationFrames = 0, const sp<IMemory>& sharedBuffer = 0, bool threadCanCallJava = false, diff --git a/include/media/Visualizer.h b/include/media/Visualizer.h index 1a4cbca..60fa15b 100644 --- a/include/media/Visualizer.h +++ b/include/media/Visualizer.h @@ -66,8 +66,8 @@ public: * See AudioEffect constructor for details on parameters. */ Visualizer(int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, + effect_callback_t cbf = NULL, + void* user = NULL, int sessionId = 0); ~Visualizer(); diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp index 6639d06..a242846 100644 --- a/media/libmedia/AudioEffect.cpp +++ b/media/libmedia/AudioEffect.cpp @@ -342,7 +342,7 @@ void AudioEffect::binderDied() { ALOGW("IEffect died"); mStatus = NO_INIT; - if (mCbf) { + if (mCbf != NULL) { status_t status = DEAD_OBJECT; mCbf(EVENT_ERROR, mUserData, &status); } @@ -363,7 +363,7 @@ void AudioEffect::controlStatusChanged(bool controlGranted) mStatus = ALREADY_EXISTS; } } - if (mCbf) { + if (mCbf != NULL) { mCbf(EVENT_CONTROL_STATUS_CHANGED, mUserData, &controlGranted); } } @@ -373,7 +373,7 @@ void AudioEffect::enableStatusChanged(bool enabled) ALOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf); if (mStatus == ALREADY_EXISTS) { mEnabled = enabled; - if (mCbf) { + if (mCbf != NULL) { mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled); } } @@ -389,7 +389,7 @@ void AudioEffect::commandExecuted(uint32_t cmdCode, return; } - if (mCbf && cmdCode == EFFECT_CMD_SET_PARAM) { + if (mCbf != NULL && cmdCode == EFFECT_CMD_SET_PARAM) { effect_param_t *cmd = (effect_param_t *)cmdData; cmd->status = *(int32_t *)replyData; mCbf(EVENT_PARAMETER_CHANGED, mUserData, cmd); diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 2b3ea38..c96bc76 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -206,7 +206,7 @@ status_t AudioRecord::set( return status; } - if (cbf != 0) { + if (cbf != NULL) { mClientRecordThread = new ClientRecordThread(*this, threadCanCallJava); } @@ -387,7 +387,7 @@ uint32_t AudioRecord::getSampleRate() status_t AudioRecord::setMarkerPosition(uint32_t marker) { - if (mCbf == 0) return INVALID_OPERATION; + if (mCbf == NULL) return INVALID_OPERATION; mMarkerPosition = marker; mMarkerReached = false; @@ -397,7 +397,7 @@ status_t AudioRecord::setMarkerPosition(uint32_t marker) status_t AudioRecord::getMarkerPosition(uint32_t *marker) { - if (marker == 0) return BAD_VALUE; + if (marker == NULL) return BAD_VALUE; *marker = mMarkerPosition; @@ -406,7 +406,7 @@ status_t AudioRecord::getMarkerPosition(uint32_t *marker) status_t AudioRecord::setPositionUpdatePeriod(uint32_t updatePeriod) { - if (mCbf == 0) return INVALID_OPERATION; + if (mCbf == NULL) return INVALID_OPERATION; uint32_t curPosition; getPosition(&curPosition); @@ -418,7 +418,7 @@ status_t AudioRecord::setPositionUpdatePeriod(uint32_t updatePeriod) status_t AudioRecord::getPositionUpdatePeriod(uint32_t *updatePeriod) { - if (updatePeriod == 0) return BAD_VALUE; + if (updatePeriod == NULL) return BAD_VALUE; *updatePeriod = mUpdatePeriod; @@ -427,7 +427,7 @@ status_t AudioRecord::getPositionUpdatePeriod(uint32_t *updatePeriod) status_t AudioRecord::getPosition(uint32_t *position) { - if (position == 0) return BAD_VALUE; + if (position == NULL) return BAD_VALUE; AutoMutex lock(mLock); *position = mCblk->user; diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index df5017b..110a294 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -225,7 +225,7 @@ status_t AudioSystem::getOutputSamplingRate(int* samplingRate, audio_stream_type gLock.lock(); outputDesc = AudioSystem::gOutputs.valueFor(output); - if (outputDesc == 0) { + if (outputDesc == NULL) { ALOGV("getOutputSamplingRate() no output descriptor for output %d in gOutputs", output); gLock.unlock(); const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); @@ -263,7 +263,7 @@ status_t AudioSystem::getOutputFrameCount(int* frameCount, audio_stream_type_t s gLock.lock(); outputDesc = AudioSystem::gOutputs.valueFor(output); - if (outputDesc == 0) { + if (outputDesc == NULL) { gLock.unlock(); const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == 0) return PERMISSION_DENIED; @@ -294,7 +294,7 @@ status_t AudioSystem::getOutputLatency(uint32_t* latency, audio_stream_type_t st gLock.lock(); outputDesc = AudioSystem::gOutputs.valueFor(output); - if (outputDesc == 0) { + if (outputDesc == NULL) { gLock.unlock(); const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger(); if (af == 0) return PERMISSION_DENIED; @@ -413,7 +413,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, v switch (event) { case STREAM_CONFIG_CHANGED: - if (param2 == 0) break; + if (param2 == NULL) break; stream = *(audio_stream_type_t *)param2; ALOGV("ioConfigChanged() STREAM_CONFIG_CHANGED stream %d, output %d", stream, ioHandle); if (gStreamOutputMap.indexOfKey(stream) >= 0) { @@ -425,7 +425,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, v ALOGV("ioConfigChanged() opening already existing output! %d", ioHandle); break; } - if (param2 == 0) break; + if (param2 == NULL) break; desc = (OutputDescriptor *)param2; OutputDescriptor *outputDesc = new OutputDescriptor(*desc); @@ -454,7 +454,7 @@ void AudioSystem::AudioFlingerClient::ioConfigChanged(int event, int ioHandle, v ALOGW("ioConfigChanged() modifying unknow output! %d", ioHandle); break; } - if (param2 == 0) break; + if (param2 == NULL) break; desc = (OutputDescriptor *)param2; ALOGV("ioConfigChanged() new config for output %d samplingRate %d, format %d channels %d frameCount %d latency %d", diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 90a67db..8c33f41 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -257,7 +257,7 @@ status_t AudioTrack::set( return status; } - if (cbf != 0) { + if (cbf != NULL) { mAudioTrackThread = new AudioTrackThread(*this, threadCanCallJava); } @@ -604,13 +604,13 @@ status_t AudioTrack::setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCou status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount) { AutoMutex lock(mLock); - if (loopStart != 0) { + if (loopStart != NULL) { *loopStart = mCblk->loopStart; } - if (loopEnd != 0) { + if (loopEnd != NULL) { *loopEnd = mCblk->loopEnd; } - if (loopCount != 0) { + if (loopCount != NULL) { if (mCblk->loopCount < 0) { *loopCount = -1; } else { @@ -623,7 +623,7 @@ status_t AudioTrack::getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCo status_t AudioTrack::setMarkerPosition(uint32_t marker) { - if (mCbf == 0) return INVALID_OPERATION; + if (mCbf == NULL) return INVALID_OPERATION; mMarkerPosition = marker; mMarkerReached = false; @@ -633,7 +633,7 @@ status_t AudioTrack::setMarkerPosition(uint32_t marker) status_t AudioTrack::getMarkerPosition(uint32_t *marker) { - if (marker == 0) return BAD_VALUE; + if (marker == NULL) return BAD_VALUE; *marker = mMarkerPosition; @@ -642,7 +642,7 @@ status_t AudioTrack::getMarkerPosition(uint32_t *marker) status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod) { - if (mCbf == 0) return INVALID_OPERATION; + if (mCbf == NULL) return INVALID_OPERATION; uint32_t curPosition; getPosition(&curPosition); @@ -654,7 +654,7 @@ status_t AudioTrack::setPositionUpdatePeriod(uint32_t updatePeriod) status_t AudioTrack::getPositionUpdatePeriod(uint32_t *updatePeriod) { - if (updatePeriod == 0) return BAD_VALUE; + if (updatePeriod == NULL) return BAD_VALUE; *updatePeriod = mUpdatePeriod; @@ -679,7 +679,7 @@ status_t AudioTrack::setPosition(uint32_t position) status_t AudioTrack::getPosition(uint32_t *position) { - if (position == 0) return BAD_VALUE; + if (position == NULL) return BAD_VALUE; AutoMutex lock(mLock); *position = mFlushed ? 0 : mCblk->server; @@ -1319,7 +1319,7 @@ void AudioTrack::AudioTrackThread::onFirstRef() audio_track_cblk_t::audio_track_cblk_t() : lock(Mutex::SHARED), cv(Condition::SHARED), user(0), server(0), - userBase(0), serverBase(0), buffers(0), frameCount(0), + userBase(0), serverBase(0), buffers(NULL), frameCount(0), loopStart(UINT_MAX), loopEnd(UINT_MAX), loopCount(0), mVolumeLR(0x10001000), mSendLevel(0), flags(0) { diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index 0d442ef..7c5589d 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -640,7 +640,7 @@ public: *id = tmp; } tmp = reply.readInt32(); - if (enabled) { + if (enabled != NULL) { *enabled = tmp; } effect = interface_cast<IEffect>(reply.readStrongBinder()); diff --git a/media/libmedia/IAudioFlingerClient.cpp b/media/libmedia/IAudioFlingerClient.cpp index 5a3f250..9458bc0 100644 --- a/media/libmedia/IAudioFlingerClient.cpp +++ b/media/libmedia/IAudioFlingerClient.cpp @@ -73,7 +73,7 @@ status_t BnAudioFlingerClient::onTransact( CHECK_INTERFACE(IAudioFlingerClient, data, reply); int event = data.readInt32(); int ioHandle = data.readInt32(); - void *param2 = 0; + void *param2 = NULL; AudioSystem::OutputDescriptor desc; uint32_t stream; if (event == AudioSystem::STREAM_CONFIG_CHANGED) { diff --git a/media/libmedia/ToneGenerator.cpp b/media/libmedia/ToneGenerator.cpp index 5ceb912..1d1f645 100644 --- a/media/libmedia/ToneGenerator.cpp +++ b/media/libmedia/ToneGenerator.cpp @@ -811,9 +811,9 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool mThreadCanCallJava = threadCanCallJava; mStreamType = streamType; mVolume = volume; - mpAudioTrack = 0; - mpToneDesc = 0; - mpNewToneDesc = 0; + mpAudioTrack = NULL; + mpToneDesc = NULL; + mpNewToneDesc = NULL; // Generate tone by chunks of 20 ms to keep cadencing precision mProcessSize = (mSamplingRate * 20) / 1000; @@ -855,7 +855,7 @@ ToneGenerator::ToneGenerator(audio_stream_type_t streamType, float volume, bool ToneGenerator::~ToneGenerator() { ALOGV("ToneGenerator destructor\n"); - if (mpAudioTrack) { + if (mpAudioTrack != NULL) { stopTone(); ALOGV("Delete Track: %p\n", mpAudioTrack); delete mpAudioTrack; @@ -1012,7 +1012,7 @@ bool ToneGenerator::initAudioTrack() { if (mpAudioTrack) { delete mpAudioTrack; - mpAudioTrack = 0; + mpAudioTrack = NULL; } // Open audio track in mono, PCM 16bit, default sampling rate, default buffer size @@ -1048,7 +1048,7 @@ initAudioTrack_exit: if (mpAudioTrack) { ALOGV("Delete Track I: %p\n", mpAudioTrack); delete mpAudioTrack; - mpAudioTrack = 0; + mpAudioTrack = NULL; } return false; @@ -1317,7 +1317,7 @@ audioCallback_EndLoop: bool ToneGenerator::prepareWave() { unsigned int segmentIdx = 0; - if (!mpNewToneDesc) { + if (mpNewToneDesc == NULL) { return false; } diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index 1a2fa66..7e2f6be 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1712,7 +1712,7 @@ String8 AudioFlinger::PlaybackThread::getParameters(const String8& keys) // audioConfigChanged_l() must be called with AudioFlinger::mLock held void AudioFlinger::PlaybackThread::audioConfigChanged_l(int event, int param) { AudioSystem::OutputDescriptor desc; - void *param2 = 0; + void *param2 = NULL; ALOGV("PlaybackThread::audioConfigChanged_l, thread %p, event %d, param %d", this, event, param); @@ -1765,7 +1765,7 @@ void AudioFlinger::PlaybackThread::readOutputParameters() status_t AudioFlinger::PlaybackThread::getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames) { - if (halFrames == 0 || dspFrames == 0) { + if (halFrames == NULL || dspFrames == NULL) { return BAD_VALUE; } Mutex::Autolock _l(mLock); @@ -3280,7 +3280,7 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase( mCblkMemory = client->heap()->allocate(size); if (mCblkMemory != 0) { mCblk = static_cast<audio_track_cblk_t *>(mCblkMemory->pointer()); - if (mCblk) { // construct the shared structure in-place. + if (mCblk != NULL) { // construct the shared structure in-place. new(mCblk) audio_track_cblk_t(); // clear all buffers mCblk->frameCount = frameCount; @@ -3323,7 +3323,7 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase( AudioFlinger::ThreadBase::TrackBase::~TrackBase() { - if (mCblk) { + if (mCblk != NULL) { mCblk->~audio_track_cblk_t(); // destroy our shared-structure. if (mClient == NULL) { delete mCblk; @@ -3398,7 +3398,7 @@ void* AudioFlinger::ThreadBase::TrackBase::getBuffer(uint32_t offset, uint32_t f server %d, serverBase %d, user %d, userBase %d", bufferStart, bufferEnd, mBuffer, mBufferEnd, cblk->server, cblk->serverBase, cblk->user, cblk->userBase); - return 0; + return NULL; } return bufferStart; @@ -4819,7 +4819,7 @@ String8 AudioFlinger::RecordThread::getParameters(const String8& keys) void AudioFlinger::RecordThread::audioConfigChanged_l(int event, int param) { AudioSystem::OutputDescriptor desc; - void *param2 = 0; + void *param2 = NULL; switch (event) { case AudioSystem::INPUT_OPENED: @@ -4997,10 +4997,10 @@ int AudioFlinger::openOutput(uint32_t *pDevices, } mPlaybackThreads.add(id, thread); - if (pSamplingRate) *pSamplingRate = samplingRate; - if (pFormat) *pFormat = format; - if (pChannels) *pChannels = channels; - if (pLatencyMs) *pLatencyMs = thread->latency(); + if (pSamplingRate != NULL) *pSamplingRate = samplingRate; + if (pFormat != NULL) *pFormat = format; + if (pChannels != NULL) *pChannels = channels; + if (pLatencyMs != NULL) *pLatencyMs = thread->latency(); // notify client processes of the new output creation thread->audioConfigChanged_l(AudioSystem::OUTPUT_OPENED); @@ -5052,7 +5052,7 @@ status_t AudioFlinger::closeOutput(int output) } } } - void *param2 = 0; + void *param2 = NULL; audioConfigChanged_l(AudioSystem::OUTPUT_CLOSED, output, param2); mPlaybackThreads.removeItem(output); } @@ -5168,9 +5168,9 @@ int AudioFlinger::openInput(uint32_t *pDevices, device); mRecordThreads.add(id, thread); ALOGV("openInput() created record thread: ID %d thread %p", id, thread); - if (pSamplingRate) *pSamplingRate = reqSamplingRate; - if (pFormat) *pFormat = format; - if (pChannels) *pChannels = reqChannels; + if (pSamplingRate != NULL) *pSamplingRate = reqSamplingRate; + if (pFormat != NULL) *pFormat = format; + if (pChannels != NULL) *pChannels = reqChannels; input->stream->common.standby(&input->stream->common); @@ -5195,7 +5195,7 @@ status_t AudioFlinger::closeInput(int input) } ALOGV("closeInput() %d", input); - void *param2 = 0; + void *param2 = NULL; audioConfigChanged_l(AudioSystem::INPUT_CLOSED, input, param2); mRecordThreads.removeItem(input); } @@ -5802,7 +5802,7 @@ sp<AudioFlinger::EffectHandle> AudioFlinger::ThreadBase::createEffect_l( // create effect handle and connect it to effect module handle = new EffectHandle(effect, client, effectClient, priority); lStatus = effect->addHandle(handle); - if (enabled) { + if (enabled != NULL) { *enabled = (int)effect->isEnabled(); } } @@ -6236,7 +6236,7 @@ size_t AudioFlinger::EffectModule::removeHandle(const wp<EffectHandle>& handle) bool enabled = false; EffectHandle *hdl = handle.unsafe_get(); - if (hdl) { + if (hdl != NULL) { ALOGV("removeHandle() unsafe_get OK"); enabled = hdl->enabled(); } @@ -6872,7 +6872,7 @@ AudioFlinger::EffectHandle::EffectHandle(const sp<EffectModule>& effect, if (mCblkMemory != 0) { mCblk = static_cast<effect_param_cblk_t *>(mCblkMemory->pointer()); - if (mCblk) { + if (mCblk != NULL) { new(mCblk) effect_param_cblk_t(); mBuffer = (uint8_t *)mCblk + bufOffset; } @@ -6969,7 +6969,7 @@ void AudioFlinger::EffectHandle::disconnect(bool unpiniflast) // release sp on module => module destructor can be called now mEffect.clear(); if (mClient != 0) { - if (mCblk) { + if (mCblk != NULL) { mCblk->~effect_param_cblk_t(); // destroy our shared-structure. } mCblkMemory.clear(); // and free the shared memory @@ -7099,7 +7099,7 @@ status_t AudioFlinger::EffectHandle::onTransact( void AudioFlinger::EffectHandle::dump(char* buffer, size_t size) { - bool locked = mCblk ? tryLock(mCblk->lock) : false; + bool locked = mCblk != NULL && tryLock(mCblk->lock); snprintf(buffer, size, "\t\t\t%05d %05d %01u %01u %05u %05u\n", (mClient == NULL) ? getpid() : mClient->pid(), diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp index 1f7d883..0b9f8ba 100644 --- a/services/audioflinger/AudioMixer.cpp +++ b/services/audioflinger/AudioMixer.cpp @@ -125,7 +125,7 @@ void AudioMixer::deleteTrackName(int name) track.enabled = 0; invalidateState(1<<name); } - if (track.resampler) { + if (track.resampler != NULL) { // delete the resampler delete track.resampler; track.resampler = NULL; @@ -809,7 +809,7 @@ void AudioMixer::process__nop(state_t* state) while (outFrames) { t1.buffer.frameCount = outFrames; t1.bufferProvider->getNextBuffer(&t1.buffer); - if (!t1.buffer.raw) break; + if (t1.buffer.raw == NULL) break; outFrames -= t1.buffer.frameCount; t1.bufferProvider->releaseBuffer(&t1.buffer); } diff --git a/services/audioflinger/AudioPolicyService.cpp b/services/audioflinger/AudioPolicyService.cpp index 7695d2b..0d8667b 100644 --- a/services/audioflinger/AudioPolicyService.cpp +++ b/services/audioflinger/AudioPolicyService.cpp @@ -144,9 +144,9 @@ AudioPolicyService::~AudioPolicyService() } mInputs.clear(); - if (mpAudioPolicy && mpAudioPolicyDev) + if (mpAudioPolicy != NULL && mpAudioPolicyDev != NULL) mpAudioPolicyDev->destroy_audio_policy(mpAudioPolicyDev, mpAudioPolicy); - if (mpAudioPolicyDev) + if (mpAudioPolicyDev != NULL) audio_policy_dev_close(mpAudioPolicyDev); } @@ -1159,7 +1159,7 @@ effect_param_t *AudioPolicyService::loadEffectParameter(cnode *root) if (param == NULL && value == NULL) { // try to parse simple parameter form {int int} param = root->first_child; - if (param) { + if (param != NULL) { // Note: that a pair of random strings is read as 0 0 int *ptr = (int *)fx_param->data; int *ptr2 = (int *)((char *)param + sizeof(effect_param_t)); |