Skip to content

Commit 32d72b2

Browse files
gkastenAndroid (Google) Code Review
authored andcommitted
Merge "Whitespace"
2 parents 85b51b8 + f743e1f commit 32d72b2

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
@@ -1589,7 +1589,7 @@ void AudioFlinger::PlaybackThread::onFirstRef()
15891589
}
15901590

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

23402340
float masterVolume = mMasterVolume;
2341-
bool masterMute = mMasterMute;
2341+
bool masterMute = mMasterMute;
23422342

23432343
if (masterMute) {
23442344
masterVolume = 0;
@@ -2377,7 +2377,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
23772377
// +1 for rounding and +1 for additional sample needed for interpolation
23782378
minFrames = (mFrameCount * t->sampleRate()) / mSampleRate + 1 + 1;
23792379
// add frames already consumed but not yet released by the resampler
2380-
// because cblk->framesReady() will include these frames
2380+
// because cblk->framesReady() will include these frames
23812381
minFrames += mAudioMixer->getUnreleasedFrames(track->name());
23822382
// the minimum track buffer size is normally twice the number of frames necessary
23832383
// to fill one buffer and the resampler should not leave more than one buffer worth
@@ -2515,6 +2515,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
25152515

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

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)