Bug 1501605 - Uplift a cubeb crash fix for Firefox 64. r=kinetik, a=RyanVM
authorAlex Chronopoulos <achronop@gmail.com>
Mon, 29 Oct 2018 04:01:00 -0400
changeset 500979 1ca9702a4960ee586097472bb2d4aaf10e3eed99
parent 500978 84baa2ea8fe21578473f9fc76f3d57fd7d6e8f7d
child 500980 88adf850f1d275f5023332b7f962aa7395c4c366
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskinetik, RyanVM
bugs1501605
milestone64.0
Bug 1501605 - Uplift a cubeb crash fix for Firefox 64. r=kinetik, a=RyanVM
media/libcubeb/src/cubeb_audiounit.cpp
media/libcubeb/update.sh
media/libcubeb/uplift-bug1500109-to-beta.patch
--- a/media/libcubeb/src/cubeb_audiounit.cpp
+++ b/media/libcubeb/src/cubeb_audiounit.cpp
@@ -834,16 +834,17 @@ audiounit_reinit_stream(cubeb_stream * s
       return CUBEB_ERROR;
     }
 
     if (audiounit_setup_stream(stm) != CUBEB_OK) {
       LOG("(%p) Stream reinit failed.", stm);
       if (flags & DEV_INPUT && input_device != 0) {
         // Attempt to re-use the same device-id failed, so attempt again with
         // default input device.
+        audiounit_close_stream(stm);
         if (audiounit_set_device_info(stm, 0, io_side::INPUT) != CUBEB_OK ||
             audiounit_setup_stream(stm) != CUBEB_OK) {
           LOG("(%p) Second stream reinit failed.", stm);
           return CUBEB_ERROR;
         }
       }
     }
 
--- a/media/libcubeb/update.sh
+++ b/media/libcubeb/update.sh
@@ -74,8 +74,11 @@ else
   echo "Remember to update README_MOZILLA with the version details."
 fi
 
 echo "Applying disable-assert.patch on top of $rev"
 patch -p3 < disable-assert.patch
 
 echo "Applying disable-device-switching.patch on top of $rev"
 patch -p3 < disable-device-switching.patch
+
+echo "Applying uplift-bug1500109-to-beta.patch on top of $rev"
+patch -p3 < uplift-bug1500109-to-beta.patch
new file mode 100644
--- /dev/null
+++ b/media/libcubeb/uplift-bug1500109-to-beta.patch
@@ -0,0 +1,21 @@
+diff --git a/media/libcubeb/src/cubeb_audiounit.cpp b/media/libcubeb/src/cubeb_audiounit.cpp
+--- a/media/libcubeb/src/cubeb_audiounit.cpp
++++ b/media/libcubeb/src/cubeb_audiounit.cpp
+@@ -834,16 +834,17 @@ audiounit_reinit_stream(cubeb_stream * s
+       return CUBEB_ERROR;
+     }
+ 
+     if (audiounit_setup_stream(stm) != CUBEB_OK) {
+       LOG("(%p) Stream reinit failed.", stm);
+       if (flags & DEV_INPUT && input_device != 0) {
+         // Attempt to re-use the same device-id failed, so attempt again with
+         // default input device.
++        audiounit_close_stream(stm);
+         if (audiounit_set_device_info(stm, 0, io_side::INPUT) != CUBEB_OK ||
+             audiounit_setup_stream(stm) != CUBEB_OK) {
+           LOG("(%p) Second stream reinit failed.", stm);
+           return CUBEB_ERROR;
+         }
+       }
+     }
+