Skip to content

Commit f743e1f

Browse files
committed
Whitespace
Fix indentation, and add blank lines in key places for clarity Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
1 parent bf02b98 commit f743e1f

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

include/common_time/local_clock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace android {
2828

2929
class LocalClock {
3030
public:
31-
LocalClock();
31+
LocalClock();
3232

3333
bool initCheck();
3434

include/media/AudioTrack.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class AudioTrack : virtual public RefBase
169169
callback_t cbf = 0,
170170
void* user = 0,
171171
int notificationFrames = 0,
172-
int sessionId = 0);
172+
int sessionId = 0);
173173

174174
/* Creates an audio track and registers it with AudioFlinger. With this constructor,
175175
* the PCM data to be rendered by AudioTrack is passed in a shared memory buffer
@@ -215,7 +215,7 @@ class AudioTrack : virtual public RefBase
215215
int notificationFrames = 0,
216216
const sp<IMemory>& sharedBuffer = 0,
217217
bool threadCanCallJava = false,
218-
int sessionId = 0);
218+
int sessionId = 0);
219219

220220

221221
/* Result of constructing the AudioTrack. This must be checked
@@ -468,6 +468,7 @@ class AudioTrack : virtual public RefBase
468468

469469
// body of AudioTrackThread::threadLoop()
470470
bool processAudioBuffer(const sp<AudioTrackThread>& thread);
471+
471472
status_t createTrack_l(audio_stream_type_t streamType,
472473
uint32_t sampleRate,
473474
audio_format_t format,

media/libmedia/AudioTrack.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ status_t AudioTrack::set(
194194
if (AudioSystem::getOutputSamplingRate(&afSampleRate, streamType) != NO_ERROR) {
195195
return NO_INIT;
196196
}
197+
197198
uint32_t afLatency;
198199
if (AudioSystem::getOutputLatency(&afLatency, streamType) != NO_ERROR) {
199200
return NO_INIT;
@@ -203,9 +204,11 @@ status_t AudioTrack::set(
203204
if (streamType == AUDIO_STREAM_DEFAULT) {
204205
streamType = AUDIO_STREAM_MUSIC;
205206
}
207+
206208
if (sampleRate == 0) {
207209
sampleRate = afSampleRate;
208210
}
211+
209212
// these below should probably come from the audioFlinger too...
210213
if (format == AUDIO_FORMAT_DEFAULT) {
211214
format = AUDIO_FORMAT_PCM_16_BIT;

services/audioflinger/AudioFlinger.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ void AudioFlinger::PlaybackThread::onFirstRef()
15881588
}
15891589

15901590
// PlaybackThread::createTrack_l() must be called with AudioFlinger::mLock held
1591-
sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrack_l(
1591+
sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrack_l(
15921592
const sp<AudioFlinger::Client>& client,
15931593
audio_stream_type_t streamType,
15941594
uint32_t sampleRate,
@@ -2337,7 +2337,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
23372337
size_t tracksWithEffect = 0;
23382338

23392339
float masterVolume = mMasterVolume;
2340-
bool masterMute = mMasterMute;
2340+
bool masterMute = mMasterMute;
23412341

23422342
if (masterMute) {
23432343
masterVolume = 0;
@@ -2376,7 +2376,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
23762376
// +1 for rounding and +1 for additional sample needed for interpolation
23772377
minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1 + 1;
23782378
// add frames already consumed but not yet released by the resampler
2379-
// because cblk->framesReady() will include these frames
2379+
// because cblk->framesReady() will include these frames
23802380
minFrames += mAudioMixer->getUnreleasedFrames(track->name());
23812381
// the minimum track buffer size is normally twice the number of frames necessary
23822382
// 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
25142514

25152515
// reset retry count
25162516
track->mRetryCount = kMaxTrackRetries;
2517+
25172518
// If one track is ready, set the mixer ready if:
25182519
// - the mixer was not ready during previous round OR
25192520
// - no other track is not ready
@@ -3372,19 +3373,19 @@ AudioFlinger::ThreadBase::TrackBase::TrackBase(
33723373
}
33733374
} else {
33743375
mCblk = (audio_track_cblk_t *)(new uint8_t[size]);
3375-
// construct the shared structure in-place.
3376-
new(mCblk) audio_track_cblk_t();
3377-
// clear all buffers
3378-
mCblk->frameCount = frameCount;
3379-
mCblk->sampleRate = sampleRate;
3380-
mChannelCount = channelCount;
3381-
mChannelMask = channelMask;
3382-
mBuffer = (char*)mCblk + sizeof(audio_track_cblk_t);
3383-
memset(mBuffer, 0, frameCount*channelCount*sizeof(int16_t));
3384-
// Force underrun condition to avoid false underrun callback until first data is
3385-
// written to buffer (other flags are cleared)
3386-
mCblk->flags = CBLK_UNDERRUN_ON;
3387-
mBufferEnd = (uint8_t *)mBuffer + bufferSize;
3376+
// construct the shared structure in-place.
3377+
new(mCblk) audio_track_cblk_t();
3378+
// clear all buffers
3379+
mCblk->frameCount = frameCount;
3380+
mCblk->sampleRate = sampleRate;
3381+
mChannelCount = channelCount;
3382+
mChannelMask = channelMask;
3383+
mBuffer = (char*)mCblk + sizeof(audio_track_cblk_t);
3384+
memset(mBuffer, 0, frameCount*channelCount*sizeof(int16_t));
3385+
// Force underrun condition to avoid false underrun callback until first data is
3386+
// written to buffer (other flags are cleared)
3387+
mCblk->flags = CBLK_UNDERRUN_ON;
3388+
mBufferEnd = (uint8_t *)mBuffer + bufferSize;
33883389
}
33893390
}
33903391

services/audioflinger/AudioMixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void AudioMixer::deleteTrackName(int name)
132132
invalidateState(1<<name);
133133
}
134134
if (track.resampler != NULL) {
135-
// delete the resampler
135+
// delete the resampler
136136
delete track.resampler;
137137
track.resampler = NULL;
138138
track.sampleRate = mSampleRate;

voip/jni/rtp/AudioGroup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@ bool AudioGroup::DeviceThread::threadLoop()
809809
AudioTrack track;
810810
AudioRecord record;
811811
if (track.set(AUDIO_STREAM_VOICE_CALL, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
812-
AUDIO_CHANNEL_OUT_MONO, output) != NO_ERROR || record.set(
813-
AUDIO_SOURCE_VOICE_COMMUNICATION, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
814-
AUDIO_CHANNEL_IN_MONO, input) != NO_ERROR) {
812+
AUDIO_CHANNEL_OUT_MONO, output) != NO_ERROR ||
813+
record.set(AUDIO_SOURCE_VOICE_COMMUNICATION, sampleRate, AUDIO_FORMAT_PCM_16_BIT,
814+
AUDIO_CHANNEL_IN_MONO, input) != NO_ERROR) {
815815
ALOGE("cannot initialize audio device");
816816
return false;
817817
}

0 commit comments

Comments
 (0)