diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2010-09-29 12:55:40 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2010-09-29 12:55:40 -0700 |
commit | 614d5407d3fac1dae8975722f25e671642041282 (patch) | |
tree | f81a0fdafe761c6cc96b0aa66179773546dd877d | |
parent | 67537364adc48cd6fa56e36d4201428b5d9dedaf (diff) | |
download | android_system_media-614d5407d3fac1dae8975722f25e671642041282.tar.gz android_system_media-614d5407d3fac1dae8975722f25e671642041282.tar.bz2 android_system_media-614d5407d3fac1dae8975722f25e671642041282.zip |
Code cleanup: function name unification.
Change-Id: I37790738d81bb8d6b5496467a93c17c6f1385b8f
-rw-r--r-- | opensles/libopensles/IBufferQueue.c | 2 | ||||
-rw-r--r-- | opensles/libopensles/android_AudioPlayer.cpp | 20 | ||||
-rw-r--r-- | opensles/libopensles/android_AudioPlayer.h | 7 | ||||
-rw-r--r-- | opensles/libopensles/locks.c | 2 | ||||
-rw-r--r-- | opensles/libopensles/sles_allinclusive.h | 3 |
5 files changed, 19 insertions, 15 deletions
diff --git a/opensles/libopensles/IBufferQueue.c b/opensles/libopensles/IBufferQueue.c index 6864b1d5..d55a6b2a 100644 --- a/opensles/libopensles/IBufferQueue.c +++ b/opensles/libopensles/IBufferQueue.c @@ -89,7 +89,7 @@ SLresult IBufferQueue_Clear(SLBufferQueueItf self) if (SL_OBJECTID_AUDIOPLAYER == InterfaceToObjectID(this)) { CAudioPlayer *audioPlayer = (CAudioPlayer *) this->mThis; // flush associated audio player - result = android_audioPlayerClear(audioPlayer); + result = android_audioPlayer_bufferQueue_onClear(audioPlayer); if (SL_RESULT_SUCCESS == result) { this->mFront = &this->mArray[0]; this->mRear = &this->mArray[0]; diff --git a/opensles/libopensles/android_AudioPlayer.cpp b/opensles/libopensles/android_AudioPlayer.cpp index 90a0ce66..29f45331 100644 --- a/opensles/libopensles/android_AudioPlayer.cpp +++ b/opensles/libopensles/android_AudioPlayer.cpp @@ -1076,11 +1076,6 @@ SLresult android_audioPlayer_destroy(CAudioPlayer *pAudioPlayer) { pAudioPlayer->mAudioTrack = NULL; } - if (pAudioPlayer->mpLock != NULL) { - delete pAudioPlayer->mpLock; - pAudioPlayer->mpLock = NULL; - } - pAudioPlayer->mAndroidObjType = INVALID_TYPE; #ifndef USE_BACKPORT @@ -1101,6 +1096,11 @@ SLresult android_audioPlayer_destroy(CAudioPlayer *pAudioPlayer) { } #endif + if (pAudioPlayer->mpLock != NULL) { + delete pAudioPlayer->mpLock; + pAudioPlayer->mpLock = NULL; + } + return result; } @@ -1422,7 +1422,7 @@ SLresult android_audioPlayer_volumeUpdate(CAudioPlayer* ap) { //----------------------------------------------------------------------------- -void android_audioPlayer_bufferQueueRefilled(CAudioPlayer *ap) { +void android_audioPlayer_bufferQueue_onRefilled(CAudioPlayer *ap) { // the AudioTrack associated with the AudioPlayer receiving audio from a PCM buffer // queue was stopped when the queue become empty, we restart as soon as a new buffer // has been enqueued since we're in playing state @@ -1443,14 +1443,16 @@ void android_audioPlayer_bufferQueueRefilled(CAudioPlayer *ap) { /* * BufferQueue::Clear */ -SLresult android_audioPlayerClear(CAudioPlayer *pAudioPlayer) { +SLresult android_audioPlayer_bufferQueue_onClear(CAudioPlayer *ap) { SLresult result = SL_RESULT_SUCCESS; - switch (pAudioPlayer->mAndroidObjType) { + switch (ap->mAndroidObjType) { //----------------------------------- // AudioTrack case AUDIOTRACK_PULL: - pAudioPlayer->mAudioTrack->flush(); + if (NULL != ap->mAudioTrack) { + ap->mAudioTrack->flush(); + } break; default: result = SL_RESULT_INTERNAL_ERROR; diff --git a/opensles/libopensles/android_AudioPlayer.h b/opensles/libopensles/android_AudioPlayer.h index ecf04b9b..052a4ee0 100644 --- a/opensles/libopensles/android_AudioPlayer.h +++ b/opensles/libopensles/android_AudioPlayer.h @@ -100,4 +100,9 @@ extern void android_audioPlayer_loop(CAudioPlayer *pAudioPlayer, SLboolean loopE extern void android_audioPlayer_getPosition(IPlay *pPlayItf, SLmillisecond *pPosMsec); -extern void android_audioPlayer_bufferQueueRefilled(CAudioPlayer *pAudioPlayer); +/************************************************************************************************** + * Buffer Queue events + ****************************/ +extern void android_audioPlayer_bufferQueue_onRefilled(CAudioPlayer *pAudioPlayer); + +extern SLresult android_audioPlayer_bufferQueue_onClear(CAudioPlayer *pAudioPlayer); diff --git a/opensles/libopensles/locks.c b/opensles/libopensles/locks.c index efe6f308..8b26b03f 100644 --- a/opensles/libopensles/locks.c +++ b/opensles/libopensles/locks.c @@ -192,7 +192,7 @@ void object_unlock_exclusive_attributes(IObject *this, unsigned attributes) ap = (CAudioPlayer *) this; if (SL_PLAYSTATE_PLAYING == ap->mPlay.mState) { #ifdef ANDROID - android_audioPlayer_bufferQueueRefilled(ap); + android_audioPlayer_bufferQueue_onRefilled(ap); #endif } } diff --git a/opensles/libopensles/sles_allinclusive.h b/opensles/libopensles/sles_allinclusive.h index 63f13216..f361f742 100644 --- a/opensles/libopensles/sles_allinclusive.h +++ b/opensles/libopensles/sles_allinclusive.h @@ -1332,9 +1332,6 @@ extern void slTraceLeaveInterfaceVoid(const char *function); #ifdef USE_SNDFILE extern void audioPlayerTransportUpdate(CAudioPlayer *audioPlayer); #endif -#ifdef ANDROID -extern SLresult android_audioPlayerClear(CAudioPlayer *pAudioPlayer); -#endif extern SLresult IBufferQueue_Enqueue(SLBufferQueueItf self, const void *pBuffer, SLuint32 size); extern SLresult IBufferQueue_Clear(SLBufferQueueItf self); |