diff options
author | Glenn Kasten <gkasten@google.com> | 2013-02-26 11:32:32 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-03-04 12:58:21 -0800 |
commit | c9b2e20f7c9a71e07ef398152709c76079decbcd (patch) | |
tree | 7e3cbee883fbe1462e24a31b8b4af5a5911e8276 /services/audioflinger | |
parent | bf04b5860182d8f4130dcb5d6d88ee68a58c99cd (diff) | |
download | frameworks_av-c9b2e20f7c9a71e07ef398152709c76079decbcd.zip frameworks_av-c9b2e20f7c9a71e07ef398152709c76079decbcd.tar.gz frameworks_av-c9b2e20f7c9a71e07ef398152709c76079decbcd.tar.bz2 |
Miscellaneous cleanup
Abbreviation framesReady to fRdy for new systrace.
Put inline const on one line.
Use local copy of mState in state.
Improve logging.
Line length 100.
Change-Id: I8201c3ce0e53fd464fd33d02544e52c342d40b68
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 4 | ||||
-rw-r--r-- | services/audioflinger/FastMixer.cpp | 6 | ||||
-rw-r--r-- | services/audioflinger/PlaybackTracks.h | 12 | ||||
-rw-r--r-- | services/audioflinger/Threads.cpp | 5 | ||||
-rw-r--r-- | services/audioflinger/TrackBase.h | 4 | ||||
-rw-r--r-- | services/audioflinger/Tracks.cpp | 2 |
6 files changed, 13 insertions, 20 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index e81267f..b3de526 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -464,7 +464,7 @@ sp<IAudioTrack> AudioFlinger::createTrack( PlaybackThread *thread = checkPlaybackThread_l(output); PlaybackThread *effectThread = NULL; if (thread == NULL) { - ALOGE("unknown output thread"); + ALOGE("no playback thread found for output handle %d", output); lStatus = BAD_VALUE; goto Exit; } @@ -589,7 +589,7 @@ uint32_t AudioFlinger::latency(audio_io_handle_t output) const Mutex::Autolock _l(mLock); PlaybackThread *thread = checkPlaybackThread_l(output); if (thread == NULL) { - ALOGW("latency() unknown thread %d", output); + ALOGW("latency(): no playback thread found for output handle %d", output); return 0; } return thread->latency(); diff --git a/services/audioflinger/FastMixer.cpp b/services/audioflinger/FastMixer.cpp index 2832e96..24a6dfe 100644 --- a/services/audioflinger/FastMixer.cpp +++ b/services/audioflinger/FastMixer.cpp @@ -388,9 +388,9 @@ bool FastMixer::threadLoop() if (ATRACE_ENABLED()) { // I wish we had formatted trace names char traceName[16]; - strcpy(traceName, "framesReady"); - traceName[11] = i + (i < 10 ? '0' : 'A' - 10); - traceName[12] = '\0'; + strcpy(traceName, "fRdy"); + traceName[4] = i + (i < 10 ? '0' : 'A' - 10); + traceName[5] = '\0'; ATRACE_INT(traceName, framesReady); } FastTrackDump *ftDump = &dumpState->mTracks[i]; diff --git a/services/audioflinger/PlaybackTracks.h b/services/audioflinger/PlaybackTracks.h index adec938..a749d7a 100644 --- a/services/audioflinger/PlaybackTracks.h +++ b/services/audioflinger/PlaybackTracks.h @@ -77,15 +77,9 @@ protected: virtual size_t framesReady() const; - bool isPausing() const { - return mState == PAUSING; - } - bool isPaused() const { - return mState == PAUSED; - } - bool isResuming() const { - return mState == RESUMING; - } + bool isPausing() const { return mState == PAUSING; } + bool isPaused() const { return mState == PAUSED; } + bool isResuming() const { return mState == RESUMING; } bool isReady() const; void setPaused() { mState = PAUSED; } void reset(); diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index ec8ffa0..9d98f0b 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -2795,7 +2795,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac // No buffers for this track. Give it a few chances to // fill a buffer, then remove it from active list. if (--(track->mRetryCount) <= 0) { - ALOGV("BUFFER TIMEOUT: remove(%d) from active list on thread %p", name, this); + ALOGI("BUFFER TIMEOUT: remove(%d) from active list on thread %p", name, this); tracksToRemove->add(track); // indicate to client process that the track was disabled because of underrun; // it will then automatically call start() when data is available @@ -3725,7 +3725,8 @@ bool AudioFlinger::RecordThread::threadLoop() readInto = mRsmpInBuffer; mRsmpInIndex = 0; } - mBytesRead = mInput->stream->read(mInput->stream, readInto, mInputBytes); + mBytesRead = mInput->stream->read(mInput->stream, readInto, + mInputBytes); if (mBytesRead <= 0) { if ((mBytesRead < 0) && (mActiveTrack->mState == TrackBase::ACTIVE)) { diff --git a/services/audioflinger/TrackBase.h b/services/audioflinger/TrackBase.h index fecbfda..fac7071 100644 --- a/services/audioflinger/TrackBase.h +++ b/services/audioflinger/TrackBase.h @@ -68,9 +68,7 @@ protected: // but putting it in TrackBase avoids the complexity of virtual inheritance virtual size_t framesReady() const { return SIZE_MAX; } - audio_format_t format() const { - return mFormat; - } + audio_format_t format() const { return mFormat; } uint32_t channelCount() const { return mChannelCount; } diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index b816338..a6ab4f8 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -607,7 +607,7 @@ status_t AudioFlinger::PlaybackThread::Track::start(AudioSystem::sync_event_t ev track_state state = mState; // here the track could be either new, or restarted // in both cases "unstop" the track - if (mState == PAUSED) { + if (state == PAUSED) { mState = TrackBase::RESUMING; ALOGV("PAUSED => RESUMING (%d) on thread %p", mName, this); } else { |