Bug 1354528: One-liner fix for bad cubeb merge to beta r=jesup a=lizzard
authorPaul Adenot <paul@paul.cx>
Sat, 08 Apr 2017 23:06:11 -0400
changeset 379499 92b071405e22a48fc95cbfcf25c3e6de5251c7d9
parent 379498 b4c7f4163f3e9d8a3652d80615037434c04682c1
child 379500 ee82facc7b9f03611b7a8c9e39f31168095ff7eb
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup, lizzard
bugs1354528
milestone53.0
Bug 1354528: One-liner fix for bad cubeb merge to beta r=jesup a=lizzard MozReview-Commit-ID: GqcpN8hxa8B
media/libcubeb/beta-crashfix-device-unplug.patch
media/libcubeb/src/cubeb_wasapi.cpp
media/libcubeb/update.sh
new file mode 100644
--- /dev/null
+++ b/media/libcubeb/beta-crashfix-device-unplug.patch
@@ -0,0 +1,21 @@
+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
+@@ -1535,16 +1535,17 @@ int setup_wasapi_stream_one_side(cubeb_s
+     if (FAILED(hr)) {
+       LOG("Could not activate the device to get an audio"
+           " client for %s: error: %lx\n", DIRECTION_NAME, hr);
+       // A particular device can't be activated because it has been
+       // unplugged, try fall back to the default audio device.
+       if (devid && hr == AUDCLNT_E_DEVICE_INVALIDATED) {
+         LOG("Trying again with the default %s audio device.", DIRECTION_NAME);
+         devid = nullptr;
++        device = nullptr;
+         try_again = true;
+       } else {
+         return CUBEB_ERROR;
+       }
+     } else {
+       try_again = false;
+     }
+   } while (try_again);
--- a/media/libcubeb/src/cubeb_wasapi.cpp
+++ b/media/libcubeb/src/cubeb_wasapi.cpp
@@ -1535,16 +1535,17 @@ int setup_wasapi_stream_one_side(cubeb_s
     if (FAILED(hr)) {
       LOG("Could not activate the device to get an audio"
           " client for %s: error: %lx\n", DIRECTION_NAME, hr);
       // A particular device can't be activated because it has been
       // unplugged, try fall back to the default audio device.
       if (devid && hr == AUDCLNT_E_DEVICE_INVALIDATED) {
         LOG("Trying again with the default %s audio device.", DIRECTION_NAME);
         devid = nullptr;
+        device = nullptr;
         try_again = true;
       } else {
         return CUBEB_ERROR;
       }
     } else {
       try_again = false;
     }
   } while (try_again);
--- a/media/libcubeb/update.sh
+++ b/media/libcubeb/update.sh
@@ -72,8 +72,11 @@ 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
 
 echo "Applying a patch on top of $version"
 patch -p3 < ./uplift-part-of-bug-1345049.patch
+
+echo "Applying a patch on top of $version"
+patch -p3 < ./beta-crashfix-device-unplug.patch