diff options
author | Glenn Kasten <gkasten@google.com> | 2012-11-06 15:03:34 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-11-06 17:25:22 -0800 |
commit | e0b07179a48ee50fda931d2aa1b3c751d167e4d7 (patch) | |
tree | d495cc851dba53652011108297d100e64a4c4acd /media | |
parent | 48c6b2628f8a6037309c7957b07129d850187aa3 (diff) | |
download | frameworks_av-e0b07179a48ee50fda931d2aa1b3c751d167e4d7.zip frameworks_av-e0b07179a48ee50fda931d2aa1b3c751d167e4d7.tar.gz frameworks_av-e0b07179a48ee50fda931d2aa1b3c751d167e4d7.tar.bz2 |
Remove CBLK_FAST from control block flags
This is part of a series to clean up the control block.
Change-Id: Ic881a3560d9547cb63fcc0cefec87aa3da480e0d
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 7 | ||||
-rw-r--r-- | media/libmedia/IAudioFlinger.cpp | 12 |
2 files changed, 12 insertions, 7 deletions
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 523d844..38eaa65 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -867,7 +867,7 @@ status_t AudioTrack::createTrack_l( format, channelMask, frameCount, - trackFlags, + &trackFlags, sharedBuffer, output, tid, @@ -887,10 +887,9 @@ status_t AudioTrack::createTrack_l( mCblkMemory = iMem; audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMem->pointer()); mCblk = cblk; - // old has the previous value of cblk->flags before the "or" operation - int32_t old = android_atomic_or(CBLK_DIRECTION, &cblk->flags); + android_atomic_or(CBLK_DIRECTION, &cblk->flags); if (flags & AUDIO_OUTPUT_FLAG_FAST) { - if (old & CBLK_FAST) { + if (trackFlags & IAudioFlinger::TRACK_FAST) { ALOGV("AUDIO_OUTPUT_FLAG_FAST successful; frameCount %u", cblk->frameCount); } else { ALOGV("AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount %u", cblk->frameCount); diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index f412591..bb936ec 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -90,7 +90,7 @@ public: audio_format_t format, audio_channel_mask_t channelMask, int frameCount, - track_flags_t flags, + track_flags_t *flags, const sp<IMemory>& sharedBuffer, audio_io_handle_t output, pid_t tid, @@ -106,7 +106,8 @@ public: data.writeInt32(format); data.writeInt32(channelMask); data.writeInt32(frameCount); - data.writeInt32((int32_t) flags); + track_flags_t lFlags = flags != NULL ? *flags : TRACK_DEFAULT; + data.writeInt32(lFlags); data.writeStrongBinder(sharedBuffer->asBinder()); data.writeInt32((int32_t) output); data.writeInt32((int32_t) tid); @@ -119,6 +120,10 @@ public: if (lStatus != NO_ERROR) { ALOGE("createTrack error: %s", strerror(-lStatus)); } else { + lFlags = reply.readInt32(); + if (flags != NULL) { + *flags = lFlags; + } lSessionId = reply.readInt32(); if (sessionId != NULL) { *sessionId = lSessionId; @@ -732,7 +737,8 @@ status_t BnAudioFlinger::onTransact( status_t status; sp<IAudioTrack> track = createTrack(pid, (audio_stream_type_t) streamType, sampleRate, format, - channelMask, bufferCount, flags, buffer, output, tid, &sessionId, &status); + channelMask, bufferCount, &flags, buffer, output, tid, &sessionId, &status); + reply->writeInt32(flags); reply->writeInt32(sessionId); reply->writeInt32(status); reply->writeStrongBinder(track->asBinder()); |