Skip to content

Commit 2333a27

Browse files
committed
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
1 parent 004f9ba commit 2333a27

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

include/media/AudioTrack.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,7 @@ class AudioTrack : virtual public RefBase
476476
int frameCount,
477477
audio_policy_output_flags_t flags,
478478
const sp<IMemory>& sharedBuffer,
479-
audio_io_handle_t output,
480-
bool enforceFrameCount);
479+
audio_io_handle_t output);
481480
void flush_l();
482481
status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount);
483482
audio_io_handle_t getOutput_l();

media/libmedia/AudioTrack.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ status_t AudioTrack::set(
261261
frameCount,
262262
flags,
263263
sharedBuffer,
264-
output,
265-
true);
264+
output);
266265

267266
if (status != NO_ERROR) {
268267
return status;
@@ -741,8 +740,7 @@ status_t AudioTrack::createTrack_l(
741740
int frameCount,
742741
audio_policy_output_flags_t flags,
743742
const sp<IMemory>& sharedBuffer,
744-
audio_io_handle_t output,
745-
bool enforceFrameCount)
743+
audio_io_handle_t output)
746744
{
747745
status_t status;
748746
const sp<IAudioFlinger>& audioFlinger = AudioSystem::get_audio_flinger();
@@ -789,7 +787,8 @@ status_t AudioTrack::createTrack_l(
789787
mNotificationFramesAct = frameCount/2;
790788
}
791789
if (frameCount < minFrameCount) {
792-
ALOGW_IF(enforceFrameCount, "Minimum buffer size corrected from %d to %d",
790+
// not ALOGW because it happens all the time when playing key clicks over A2DP
791+
ALOGV("Minimum buffer size corrected from %d to %d",
793792
frameCount, minFrameCount);
794793
frameCount = minFrameCount;
795794
}
@@ -1249,8 +1248,7 @@ status_t AudioTrack::restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart)
12491248
mFrameCount,
12501249
mFlags,
12511250
mSharedBuffer,
1252-
getOutput_l(),
1253-
false);
1251+
getOutput_l());
12541252

12551253
if (result == NO_ERROR) {
12561254
uint32_t user = cblk->user;

0 commit comments

Comments
 (0)