summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-14 12:56:26 -0700
committerGlenn Kasten <gkasten@google.com>2012-03-19 17:53:33 -0700
commitea7939a079b3600cab955760839b021326f8cfc3 (patch)
tree570fb56838735a46a28e28a4f083d763f758ea24 /services
parenteb76ff27c13386eb5a2dad73b1a8366f80eb0ff7 (diff)
downloadframeworks_av-ea7939a079b3600cab955760839b021326f8cfc3.zip
frameworks_av-ea7939a079b3600cab955760839b021326f8cfc3.tar.gz
frameworks_av-ea7939a079b3600cab955760839b021326f8cfc3.tar.bz2
Whitespace
Fix indentation, and add blank lines in key places for clarity Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp33
-rw-r--r--services/audioflinger/AudioMixer.cpp2
2 files changed, 18 insertions, 17 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index d83d19a..86bb7f9 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1588,7 +1588,7 @@ void AudioFlinger::PlaybackThread::onFirstRef()
}
// PlaybackThread::createTrack_l() must be called with AudioFlinger::mLock held
-sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrack_l(
+sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrack_l(
const sp<AudioFlinger::Client>& client,
audio_stream_type_t streamType,
uint32_t sampleRate,
@@ -2337,7 +2337,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
size_t tracksWithEffect = 0;
float masterVolume = mMasterVolume;
- bool masterMute = mMasterMute;
+ bool masterMute = mMasterMute;
if (masterMute) {
masterVolume = 0;
@@ -2376,7 +2376,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
// +1 for rounding and +1 for additional sample needed for interpolation
minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1 + 1;
// add frames already consumed but not yet released by the resampler
- // because cblk->framesReady() will include these frames
+ // because cblk->framesReady() will include these frames
minFrames += mAudioMixer->getUnreleasedFrames(track->name());
// the minimum track buffer size is normally twice the number of frames necessary
// to fill one buffer and the resampler should not leave more than one buffer worth
@@ -2514,6 +2514,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
// reset retry count
track->mRetryCount = kMaxTrackRetries;
+
// If one track is ready, set the mixer ready if:
// - the mixer was not ready during previous round OR
// - no other track is not ready
@@ -3372,19 +3373,19 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
}
} else {
mCblk = (audio_track_cblk_t *)(new uint8_t[size]);
- // construct the shared structure in-place.
- new(mCblk) audio_track_cblk_t();
- // clear all buffers
- mCblk->frameCount = frameCount;
- mCblk->sampleRate = sampleRate;
- mChannelCount = channelCount;
- mChannelMask = channelMask;
- mBuffer = (char*)mCblk + sizeof(audio_track_cblk_t);
- memset(mBuffer, 0, frameCount*channelCount*sizeof(int16_t));
- // Force underrun condition to avoid false underrun callback until first data is
- // written to buffer (other flags are cleared)
- mCblk->flags = CBLK_UNDERRUN_ON;
- mBufferEnd = (uint8_t *)mBuffer + bufferSize;
+ // construct the shared structure in-place.
+ new(mCblk) audio_track_cblk_t();
+ // clear all buffers
+ mCblk->frameCount = frameCount;
+ mCblk->sampleRate = sampleRate;
+ mChannelCount = channelCount;
+ mChannelMask = channelMask;
+ mBuffer = (char*)mCblk + sizeof(audio_track_cblk_t);
+ memset(mBuffer, 0, frameCount*channelCount*sizeof(int16_t));
+ // Force underrun condition to avoid false underrun callback until first data is
+ // written to buffer (other flags are cleared)
+ mCblk->flags = CBLK_UNDERRUN_ON;
+ mBufferEnd = (uint8_t *)mBuffer + bufferSize;
}
}
diff --git a/services/audioflinger/AudioMixer.cpp b/services/audioflinger/AudioMixer.cpp
index 1ec238b..6e761ba 100644
--- a/services/audioflinger/AudioMixer.cpp
+++ b/services/audioflinger/AudioMixer.cpp
@@ -132,7 +132,7 @@ void AudioMixer::deleteTrackName(int name)
invalidateState(1<<name);
}
if (track.resampler != NULL) {
- // delete the resampler
+ // delete the resampler
delete track.resampler;
track.resampler = NULL;
track.sampleRate = mSampleRate;