Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ff1429b authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: Fix timestamp advancing interval constant

Prior value caused false underrun detection and pause
for Direct and Offload playback.

Test: atest android.media.decoder.cts.DecoderTest#testTunneledAudioUnderrunVp9
Bug: 317163842
Change-Id: I0e25e425102bfa176e96b7d14553f13d7135292d
parent f57a2e0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ static const nsecs_t kDirectMinSleepTimeUs = 10000;
// Minimum amount of time between checking to see if the timestamp is advancing
// for underrun detection. If we check too frequently, we may not detect a
// timestamp update and will falsely detect underrun.
static const nsecs_t kMinimumTimeBetweenTimestampChecksNs = 150 /* ms */ * 1000;
static constexpr nsecs_t kMinimumTimeBetweenTimestampChecksNs = 150 /* ms */ * 1'000'000;

// The universal constant for ubiquitous 20ms value. The value of 20ms seems to provide a good
// balance between power consumption and latency, and allows threads to be scheduled reliably