forked from mirrors/gecko-dev
Bug 1944150 - Remove WASAPI stream shutdown timeout. r=cubeb-reviewers,padenot a=dmeehan
Differential Revision: https://phabricator.services.mozilla.com/D236070
This commit is contained in:
parent
09639b067e
commit
0d315ac668
3 changed files with 35 additions and 10 deletions
33
media/libcubeb/0005-remove-wasapi-timeout.patch
Normal file
33
media/libcubeb/0005-remove-wasapi-timeout.patch
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
From 2816b5a7b10899b8500352d6bd410a0f1a7699bf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Matthew Gregan <kinetik@flim.org>
|
||||||
|
Date: Thu, 9 Jan 2025 10:36:24 +1300
|
||||||
|
Subject: [PATCH] wasapi: Remove thread shutdown timeout.
|
||||||
|
|
||||||
|
This was a workaround for rare pre-Windows 10 systems where the render
|
||||||
|
thread would hang inside OS API calls for multiple seconds.
|
||||||
|
---
|
||||||
|
src/cubeb_wasapi.cpp | 11 +----------
|
||||||
|
1 file changed, 1 insertion(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
|
||||||
|
index f13c5ad7..d3786b68 100644
|
||||||
|
--- a/src/cubeb_wasapi.cpp
|
||||||
|
+++ b/src/cubeb_wasapi.cpp
|
||||||
|
@@ -1780,16 +1780,7 @@ stop_and_join_render_thread(cubeb_stream * stm)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* Wait five seconds for the rendering thread to return. It's supposed to
|
||||||
|
- * check its event loop very often, five seconds is rather conservative.
|
||||||
|
- * Note: 5*1s loop to work around timer sleep issues on pre-Windows 8. */
|
||||||
|
- DWORD r;
|
||||||
|
- for (int i = 0; i < 5; ++i) {
|
||||||
|
- r = WaitForSingleObject(stm->thread, 1000);
|
||||||
|
- if (r == WAIT_OBJECT_0) {
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ DWORD r = WaitForSingleObject(stm->thread, INFINITE);
|
||||||
|
if (r != WAIT_OBJECT_0) {
|
||||||
|
LOG("stop_and_join_render_thread: WaitForSingleObject on thread failed: "
|
||||||
|
"%lx, %lx",
|
||||||
|
|
@ -21,6 +21,7 @@ vendoring:
|
||||||
- 0002-disable-crash-reporter-death-test.patch
|
- 0002-disable-crash-reporter-death-test.patch
|
||||||
- 0003-audiounit-ios-compile-fixes.patch
|
- 0003-audiounit-ios-compile-fixes.patch
|
||||||
- 0004-disable-cubeb_one_duplex_one_input-macos10.15.patch
|
- 0004-disable-cubeb_one_duplex_one_input-macos10.15.patch
|
||||||
|
- 0005-remove-wasapi-timeout.patch
|
||||||
skip-vendoring-steps:
|
skip-vendoring-steps:
|
||||||
- update-moz-build
|
- update-moz-build
|
||||||
exclude:
|
exclude:
|
||||||
|
|
|
||||||
|
|
@ -1780,16 +1780,7 @@ stop_and_join_render_thread(cubeb_stream * stm)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait five seconds for the rendering thread to return. It's supposed to
|
DWORD r = WaitForSingleObject(stm->thread, INFINITE);
|
||||||
* check its event loop very often, five seconds is rather conservative.
|
|
||||||
* Note: 5*1s loop to work around timer sleep issues on pre-Windows 8. */
|
|
||||||
DWORD r;
|
|
||||||
for (int i = 0; i < 5; ++i) {
|
|
||||||
r = WaitForSingleObject(stm->thread, 1000);
|
|
||||||
if (r == WAIT_OBJECT_0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (r != WAIT_OBJECT_0) {
|
if (r != WAIT_OBJECT_0) {
|
||||||
LOG("stop_and_join_render_thread: WaitForSingleObject on thread failed: "
|
LOG("stop_and_join_render_thread: WaitForSingleObject on thread failed: "
|
||||||
"%lx, %lx",
|
"%lx, %lx",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue