@@ -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
0 commit comments