Bug 1501605 - Update cubeb from upstream to 04d58b6. r=kinetik
authorAlex Chronopoulos <achronop@gmail.com>
Wed, 24 Oct 2018 12:37:51 +0200
changeset 491063 73b5fa4feb449d10c332c24c8bbac7af8329c7d2
parent 491062 3377d76041ed9940b811024745441d7b8846b29a
child 491064 5722affcf49d606d48cd70349443baea978caa98
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerskinetik
bugs1501605
milestone65.0a1
Bug 1501605 - Update cubeb from upstream to 04d58b6. r=kinetik
media/libcubeb/README_MOZILLA
media/libcubeb/include/cubeb.h
media/libcubeb/src/cubeb_audiounit.cpp
--- a/media/libcubeb/README_MOZILLA
+++ b/media/libcubeb/README_MOZILLA
@@ -1,8 +1,8 @@
 The source from this directory was copied from the cubeb
 git repository using the update.sh script.  The only changes
 made were those applied by update.sh and the addition of
 Makefile.in build files for the Mozilla build system.
 
 The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
 
-The git commit ID used was a68892dff73bad5ca2b25008b07d0b06fc850391 (2018-10-19 12:17:40 +0200)
+The git commit ID used was 04d58b66057171d25413498b3a4d0607fd500bb8 (2018-10-24 08:43:52 +1300)
--- a/media/libcubeb/include/cubeb.h
+++ b/media/libcubeb/include/cubeb.h
@@ -626,19 +626,23 @@ CUBEB_EXPORT int cubeb_enumerate_devices
     @retval CUBEB_OK
     @retval CUBEB_ERROR_INVALID_PARAMETER if collection is an invalid pointer */
 CUBEB_EXPORT int cubeb_device_collection_destroy(cubeb * context,
                                                  cubeb_device_collection * collection);
 
 /** Registers a callback which is called when the system detects
     a new device or a device is removed.
     @param context
-    @param devtype device type to include
+    @param devtype device type to include. Different callbacks and user pointers
+           can be registered for each devtype. The hybrid devtype
+           `CUBEB_DEVICE_TYPE_INPUT | CUBEB_DEVICE_TYPE_OUTPUT` is also valid
+           and will register the provided callback and user pointer in both sides.
     @param callback a function called whenever the system device list changes.
-           Passing NULL allow to unregister a function
+           Passing NULL allow to unregister a function. You have to unregister
+           first before you register a new callback.
     @param user_ptr pointer to user specified data which will be present in
            subsequent callbacks.
     @retval CUBEB_ERROR_NOT_SUPPORTED */
 CUBEB_EXPORT int cubeb_register_device_collection_changed(cubeb * context,
                                                           cubeb_device_type devtype,
                                                           cubeb_device_collection_changed_callback callback,
                                                           void * user_ptr);
 
--- 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;
         }
       }
     }