From 2333a27ee528e97400d41838696258f29aa48688 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Mon, 19 Mar 2012 12:16:56 -0700 Subject: Remove enforceFrameCount It was only used to decide whether to issue a warning. The warning was issued the first time track was created but not at re-creation. Now it is a verbose message every time, not a warning since it happens all the time with key clicks on A2DP. Change-Id: I9d39f53c0a7eb84b666e55b1b76ff830cf8f37ba --- include/media/AudioTrack.h | 3 +-- media/libmedia/AudioTrack.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index ad27a1e1ca4a..7d5d772ff941 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -476,8 +476,7 @@ protected: int frameCount, audio_policy_output_flags_t flags, const sp& sharedBuffer, - audio_io_handle_t output, - bool enforceFrameCount); + audio_io_handle_t output); void flush_l(); status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); audio_io_handle_t getOutput_l(); diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 55cd3ad5c341..50fbf3617eb9 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -261,8 +261,7 @@ status_t AudioTrack::set( frameCount, flags, sharedBuffer, - output, - true); + output); if (status != NO_ERROR) { return status; @@ -741,8 +740,7 @@ status_t AudioTrack::createTrack_l( int frameCount, audio_policy_output_flags_t flags, const sp& sharedBuffer, - audio_io_handle_t output, - bool enforceFrameCount) + audio_io_handle_t output) { status_t status; const sp& audioFlinger = AudioSystem::get_audio_flinger(); @@ -789,7 +787,8 @@ status_t AudioTrack::createTrack_l( mNotificationFramesAct = frameCount/2; } if (frameCount < minFrameCount) { - ALOGW_IF(enforceFrameCount, "Minimum buffer size corrected from %d to %d", + // not ALOGW because it happens all the time when playing key clicks over A2DP + ALOGV("Minimum buffer size corrected from %d to %d", frameCount, minFrameCount); frameCount = minFrameCount; } @@ -1249,8 +1248,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart) mFrameCount, mFlags, mSharedBuffer, - getOutput_l(), - false); + getOutput_l()); if (result == NO_ERROR) { uint32_t user = cblk->user; -- cgit v1.2.3-59-g8ed1b