Bug 1930825 Increase frames per data callback to at least 1024 on Android r=padenot

The minimum is applied unless media.cubeb_latency_mtg_frames is set.

Differential Revision: https://phabricator.services.mozilla.com/D228766
This commit is contained in:
Karl Tomlinson 2024-11-18 21:13:45 +00:00
parent b352127d18
commit 923e67d49d

View File

@ -685,12 +685,11 @@ uint32_t GetCubebMTGLatencyInFrames(cubeb_stream_params* params) {
}
#ifdef MOZ_WIDGET_ANDROID
int frames = AndroidGetAudioOutputFramesPerBuffer();
if (frames > 0) {
return frames;
} else {
return 512;
}
int32_t frames = AndroidGetAudioOutputFramesPerBuffer();
// Allow extra time until audioipc threads are scheduled with higher
// priority (bug 1931080). 768 was not sufficient on a Samsung SM-A528B
// when switching to the home screen.
return std::max(1024, frames);
#else
RefPtr<CubebHandle> handle = GetCubebUnlocked();
if (!handle) {