Bug 1589931 - P2: Update cubeb-audiounit-rs to 0920240. r=padenot
authorChun-Min Chang <chun.m.chang@gmail.com>
Thu, 14 Nov 2019 21:00:16 +0000
changeset 502077 e6727b7a53916137d8f9988ab70d9e26ed72561b
parent 502076 51cd57a31ea775eeb8605c160cb363512ab6cd2a
child 502078 36bef03d2b69c674ab63f0e0ea46819d456ab267
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1589931, 920240
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1589931 - P2: Update cubeb-audiounit-rs to 0920240. r=padenot Pick commits: 0920240 - Always return null-terminated strings from current_device (#25) Differential Revision: https://phabricator.services.mozilla.com/D52880
media/libcubeb/cubeb-coreaudio-rs/README_MOZILLA
media/libcubeb/cubeb-coreaudio-rs/src/backend/mod.rs
--- a/media/libcubeb/cubeb-coreaudio-rs/README_MOZILLA
+++ b/media/libcubeb/cubeb-coreaudio-rs/README_MOZILLA
@@ -1,6 +1,6 @@
 The source from this directory was copied from the cubeb-coreaudio-rs
 git repository using the update.sh script.
 
 The cubeb-coreaudio-rs git repository is: https://github.com/ChunMinChang/cubeb-coreaudio-rs
 
-The git commit ID used was cd954ca94baafc1bd0c4c661f07b816e9263ed1b (2019-10-25 08:42:19 -0700)
+The git commit ID used was 0920240e4166d2b562840c8062e149d63f7c3a02 (2019-11-13 09:18:08 -0800)
--- a/media/libcubeb/cubeb-coreaudio-rs/src/backend/mod.rs
+++ b/media/libcubeb/cubeb-coreaudio-rs/src/backend/mod.rs
@@ -3465,23 +3465,30 @@ impl<'ctx> StreamOps for AudioUnitStream
         set_volume(self.core_stream_data.output_unit, volume)
     }
     #[cfg(target_os = "ios")]
     fn current_device(&mut self) -> Result<&DeviceRef> {
         Err(not_supported())
     }
     #[cfg(not(target_os = "ios"))]
     fn current_device(&mut self) -> Result<&DeviceRef> {
-        let mut device: Box<ffi::cubeb_device> = Box::new(ffi::cubeb_device::default());
-        if let Ok(source) = audiounit_get_default_datasource_string(DeviceType::INPUT) {
-            device.input_name = source.into_raw();
+        let input_name = audiounit_get_default_datasource_string(DeviceType::INPUT);
+        let output_name = audiounit_get_default_datasource_string(DeviceType::OUTPUT);
+        if input_name.is_err() && output_name.is_err() {
+            return Err(Error::error());
         }
-        if let Ok(source) = audiounit_get_default_datasource_string(DeviceType::OUTPUT) {
-            device.output_name = source.into_raw();
-        }
+
+        let mut device: Box<ffi::cubeb_device> = Box::new(ffi::cubeb_device::default());
+
+        let input_name = input_name.unwrap_or(CString::default());
+        device.input_name = input_name.into_raw();
+
+        let output_name = output_name.unwrap_or(CString::default());
+        device.output_name = output_name.into_raw();
+
         Ok(unsafe { DeviceRef::from_ptr(Box::into_raw(device)) })
     }
     #[cfg(target_os = "ios")]
     fn device_destroy(&mut self, device: &DeviceRef) -> Result<()> {
         Err(not_supported())
     }
     #[cfg(not(target_os = "ios"))]
     fn device_destroy(&mut self, device: &DeviceRef) -> Result<()> {