summaryrefslogtreecommitdiff
path: root/dom/media/GraphDriver.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-08-22 17:39:55 +0000
committerMoonchild <moonchild@palemoon.org>2021-08-22 17:39:55 +0000
commitcb93c28fc097fe0858f2de894f053028aaaf8b74 (patch)
tree97ff8ce2e72b017abb9f529283812c56ae10b9c5 /dom/media/GraphDriver.cpp
parentc7fab85fcb7193764e87447033c7fe1e487ba89f (diff)
downloadaura-central-cb93c28fc097fe0858f2de894f053028aaaf8b74.tar.gz
Revert "Issue mcp-graveyard/UXP%1806 - Update libcubeb"
This reverts commit 741fd8b61ccc5b3a01ccf8ff154ccb8ce80ecc38.
Diffstat (limited to 'dom/media/GraphDriver.cpp')
-rw-r--r--dom/media/GraphDriver.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp
index 70b59c61f..90680d8c6 100644
--- a/dom/media/GraphDriver.cpp
+++ b/dom/media/GraphDriver.cpp
@@ -593,6 +593,7 @@ AudioCallbackDriver::Init()
cubeb_stream_params output;
cubeb_stream_params input;
+ uint32_t latency_frames;
MOZ_ASSERT(!NS_IsMainThread(),
"This is blocking and should never run on the main thread.");
@@ -608,7 +609,14 @@ AudioCallbackDriver::Init()
output.format = CUBEB_SAMPLE_FLOAT32NE;
}
- uint32_t latency_frames = CubebUtils::GetCubebMSGLatencyInFrames(&output);
+ Maybe<uint32_t> latencyPref = CubebUtils::GetCubebMSGLatencyInFrames();
+ if (latencyPref) {
+ latency_frames = latencyPref.value();
+ } else {
+ if (cubeb_get_min_latency(cubebContext, output, &latency_frames) != CUBEB_OK) {
+ NS_WARNING("Could not get minimal latency from cubeb.");
+ }
+ }
input = output;
input.channels = mInputChannels; // change to support optional stereo capture