summaryrefslogtreecommitdiff
path: root/media/libcubeb/fix-crashes.patch
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-08-12 14:14:18 +0000
committerMoonchild <moonchild@palemoon.org>2021-08-12 14:14:18 +0000
commit414c47071149a9ce6193dba85c77ce2360e41ff2 (patch)
tree84249949ea79a4db724097c4924e986484a9733b /media/libcubeb/fix-crashes.patch
parent4dd783f928ac88f285a83971f651a5a19193d110 (diff)
downloadaura-central-414c47071149a9ce6193dba85c77ce2360e41ff2.tar.gz
Issue mcp-graveyard/UXP%1806 - Update libcubeb
This is a full lib update, changing callers where needed. This also moves GertCubeMSGLatencyInFrames to CubebUtils.{cpp|h} where it belongs.
Diffstat (limited to 'media/libcubeb/fix-crashes.patch')
-rw-r--r--media/libcubeb/fix-crashes.patch71
1 files changed, 0 insertions, 71 deletions
diff --git a/media/libcubeb/fix-crashes.patch b/media/libcubeb/fix-crashes.patch
deleted file mode 100644
index b23501fcf..000000000
--- a/media/libcubeb/fix-crashes.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-This patch fixes three different crashes, one crash per chunk in this patch,
-in the same order.
-- Bug 1342389
-- Bug 1345147
-- Bug 1347453
-
-diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp
---- a/media/libcubeb/src/cubeb_wasapi.cpp
-+++ b/media/libcubeb/src/cubeb_wasapi.cpp
-@@ -878,16 +878,23 @@ wasapi_stream_render_loop(LPVOID stream)
-
- /* WaitForMultipleObjects timeout can trigger in cases where we don't want to
- treat it as a timeout, such as across a system sleep/wake cycle. Trigger
- the timeout error handling only when the timeout_limit is reached, which is
- reset on each successful loop. */
- unsigned timeout_count = 0;
- const unsigned timeout_limit = 5;
- while (is_playing) {
-+ // We want to check the emergency bailout variable before a
-+ // and after the WaitForMultipleObject, because the handles WaitForMultipleObjects
-+ // is going to wait on might have been closed already.
-+ if (*emergency_bailout) {
-+ delete emergency_bailout;
-+ return 0;
-+ }
- DWORD waitResult = WaitForMultipleObjects(ARRAY_LENGTH(wait_array),
- wait_array,
- FALSE,
- 1000);
- if (*emergency_bailout) {
- delete emergency_bailout;
- return 0;
- }
-@@ -1199,16 +1206,22 @@ bool stop_and_join_render_thread(cubeb_s
- {
- bool rv = true;
- LOG("Stop and join render thread.");
- if (!stm->thread) {
- LOG("No thread present.");
- return true;
- }
-
-+ // If we've already leaked the thread, just return,
-+ // there is not much we can do.
-+ if (!stm->emergency_bailout.load()) {
-+ return false;
-+ }
-+
- BOOL ok = SetEvent(stm->shutdown_event);
- if (!ok) {
- LOG("Destroy SetEvent failed: %lx", GetLastError());
- }
-
- /* Wait five seconds for the rendering thread to return. It's supposed to
- * check its event loop very often, five seconds is rather conservative. */
- DWORD r = WaitForSingleObject(stm->thread, 5000);
-diff --git a/media/libcubeb/update.sh b/media/libcubeb/update.sh
---- a/media/libcubeb/update.sh
-+++ b/media/libcubeb/update.sh
-@@ -66,8 +66,11 @@ fi
- echo "Applying a patch on top of $version"
- patch -p1 < ./wasapi-drift-fix-passthrough-resampler.patch
-
- echo "Applying a patch on top of $version"
- patch -p1 < ./audiounit-drift-fix.patch
-
- echo "Applying a patch on top of $version"
- patch -p1 < ./uplift-wasapi-fixes-aurora.patch
-+
-+echo "Applying a patch on top of $version"
-+patch -p3 < ./fix-crashes.patch