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