From e0b07179a48ee50fda931d2aa1b3c751d167e4d7 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 6 Nov 2012 15:03:34 -0800 Subject: Remove CBLK_FAST from control block flags This is part of a series to clean up the control block. Change-Id: Ic881a3560d9547cb63fcc0cefec87aa3da480e0d --- services/audioflinger/AudioFlinger.cpp | 15 +++++++-------- services/audioflinger/AudioFlinger.h | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'services') diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index cb44114..379e936 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -451,7 +451,7 @@ sp AudioFlinger::createTrack( audio_format_t format, audio_channel_mask_t channelMask, int frameCount, - IAudioFlinger::track_flags_t flags, + IAudioFlinger::track_flags_t *flags, const sp& sharedBuffer, audio_io_handle_t output, pid_t tid, @@ -1725,17 +1725,17 @@ sp AudioFlinger::PlaybackThread::createTrac int frameCount, const sp& sharedBuffer, int sessionId, - IAudioFlinger::track_flags_t flags, + IAudioFlinger::track_flags_t *flags, pid_t tid, status_t *status) { sp track; status_t lStatus; - bool isTimed = (flags & IAudioFlinger::TRACK_TIMED) != 0; + bool isTimed = (*flags & IAudioFlinger::TRACK_TIMED) != 0; // client expresses a preference for FAST, but we get the final say - if (flags & IAudioFlinger::TRACK_FAST) { + if (*flags & IAudioFlinger::TRACK_FAST) { if ( // not timed (!isTimed) && @@ -1781,7 +1781,7 @@ sp AudioFlinger::PlaybackThread::createTrac isTimed, sharedBuffer.get(), frameCount, mFrameCount, format, audio_is_linear_pcm(format), channelMask, sampleRate, mSampleRate, hasFastMixer(), tid, mFastTrackAvailMask); - flags &= ~IAudioFlinger::TRACK_FAST; + *flags &= ~IAudioFlinger::TRACK_FAST; // For compatibility with AudioTrack calculation, buffer depth is forced // to be at least 2 x the normal mixer frame count and cover audio hardware latency. // This is probably too conservative, but legacy application code may depend on it. @@ -1845,7 +1845,7 @@ sp AudioFlinger::PlaybackThread::createTrac if (!isTimed) { track = new Track(this, client, streamType, sampleRate, format, - channelMask, frameCount, sharedBuffer, sessionId, flags); + channelMask, frameCount, sharedBuffer, sessionId, *flags); } else { track = TimedTrack::create(this, client, streamType, sampleRate, format, channelMask, frameCount, sharedBuffer, sessionId); @@ -1864,7 +1864,7 @@ sp AudioFlinger::PlaybackThread::createTrac chain->incTrackCnt(); } - if ((flags & IAudioFlinger::TRACK_FAST) && (tid != -1)) { + if ((*flags & IAudioFlinger::TRACK_FAST) && (tid != -1)) { pid_t callingPid = IPCThreadState::self()->getCallingPid(); // we don't have CAP_SYS_NICE, nor do we want to have it as it's too powerful, // so ask activity manager to do this on our behalf @@ -4377,7 +4377,6 @@ AudioFlinger::PlaybackThread::Track::Track( } // only allocate a fast track index if we were able to allocate a normal track name if (flags & IAudioFlinger::TRACK_FAST) { - mCblk->flags |= CBLK_FAST; // atomic op not needed yet ALOG_ASSERT(thread->mFastTrackAvailMask != 0); int i = __builtin_ctz(thread->mFastTrackAvailMask); ALOG_ASSERT(0 < i && i < (int)FastMixerState::kMaxFastTracks); diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 2251b45..de2fbfa 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -93,7 +93,7 @@ public: audio_format_t format, audio_channel_mask_t channelMask, int frameCount, - IAudioFlinger::track_flags_t flags, + IAudioFlinger::track_flags_t *flags, const sp& sharedBuffer, audio_io_handle_t output, pid_t tid, @@ -1089,7 +1089,7 @@ public: int frameCount, const sp& sharedBuffer, int sessionId, - IAudioFlinger::track_flags_t flags, + IAudioFlinger::track_flags_t *flags, pid_t tid, status_t *status); -- cgit v1.1