Bug 1628634 - mach vendor rust. r=padenot
authorAlex Chronopoulos <achronop@gmail.com>
Wed, 22 Apr 2020 12:08:08 +0000
changeset 525375 2203d818a3b488bb86ec28ef264d63fae053d3ea
parent 525374 9b5ba030372a589d6b0d82c2550ca1dffe491f82
child 525376 69cb6fb25d2f0818a7214af7f509d735a8dd7f21
push id113673
push userachronopoulos@mozilla.com
push dateWed, 22 Apr 2020 12:13:43 +0000
treeherderautoland@2203d818a3b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspadenot
bugs1628634
milestone77.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 1628634 - mach vendor rust. r=padenot Depends on D71929 Differential Revision: https://phabricator.services.mozilla.com/D71930
.cargo/config.in
Cargo.lock
third_party/rust/cubeb-pulse/.cargo-checksum.json
third_party/rust/cubeb-pulse/src/backend/stream.rs
--- a/.cargo/config.in
+++ b/.cargo/config.in
@@ -40,17 +40,17 @@ tag = "v0.3.0"
 [source."https://github.com/hsivonen/packed_simd"]
 git = "https://github.com/hsivonen/packed_simd"
 replace-with = "vendored-sources"
 rev = "3541e3818fdc7c2a24f87e3459151a4ce955a67a"
 
 [source."https://github.com/djg/cubeb-pulse-rs"]
 git = "https://github.com/djg/cubeb-pulse-rs"
 replace-with = "vendored-sources"
-rev = "e845327c3fe91192870a34fc2999d2f460291295"
+rev = "8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5"
 
 [source."https://github.com/bytecodealliance/wasmtime"]
 git = "https://github.com/bytecodealliance/wasmtime"
 replace-with = "vendored-sources"
 rev = "6a68130d5b0296379fae0b8de5fbb8a1499b67a5"
 
 [source."https://github.com/badboy/failure"]
 git = "https://github.com/badboy/failure"
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -939,17 +939,17 @@ dependencies = [
  "libc",
  "mach",
  "ringbuf",
 ]
 
 [[package]]
 name = "cubeb-pulse"
 version = "0.3.0"
-source = "git+https://github.com/djg/cubeb-pulse-rs?rev=e845327c3fe91192870a34fc2999d2f460291295#e845327c3fe91192870a34fc2999d2f460291295"
+source = "git+https://github.com/djg/cubeb-pulse-rs?rev=8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5#8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5"
 dependencies = [
  "cubeb-backend",
  "pulse",
  "pulse-ffi",
  "ringbuf",
  "semver",
 ]
 
@@ -3405,26 +3405,26 @@ dependencies = [
  "rustc-demangle",
  "thin-vec",
  "uuid",
 ]
 
 [[package]]
 name = "pulse"
 version = "0.3.0"
-source = "git+https://github.com/djg/cubeb-pulse-rs?rev=e845327c3fe91192870a34fc2999d2f460291295#e845327c3fe91192870a34fc2999d2f460291295"
+source = "git+https://github.com/djg/cubeb-pulse-rs?rev=8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5#8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5"
 dependencies = [
  "bitflags",
  "pulse-ffi",
 ]
 
 [[package]]
 name = "pulse-ffi"
 version = "0.1.0"
-source = "git+https://github.com/djg/cubeb-pulse-rs?rev=e845327c3fe91192870a34fc2999d2f460291295#e845327c3fe91192870a34fc2999d2f460291295"
+source = "git+https://github.com/djg/cubeb-pulse-rs?rev=8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5#8375ed3cd2fb85add5800fa2eb6ec7bfc8e6bbf5"
 dependencies = [
  "libc",
 ]
 
 [[package]]
 name = "quick-error"
 version = "1.2.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
--- a/third_party/rust/cubeb-pulse/.cargo-checksum.json
+++ b/third_party/rust/cubeb-pulse/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".travis.yml":"0394e2adb041175457685cde5ee05ff04bdab8885fd8a62551f2ff43d9e48872","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"297f0144bbebcbc2f3b5478fed750f39adb3b60f9d6c273dfa72d9736818423d","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"e6a98ee5630b9ce1a096a2907d095454f2770e298a5b0976ab552cc53ca96cfc","src/backend/context.rs":"33d9fdf1504fe1ae43d301e288daf6eaeabeb47aa0ef86efa135c6d984425fc4","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"374a9a3bd79fddc47739dda1dbfc5929aea5a91946794fe65fba3c8d130fbda9","src/backend/mod.rs":"06ce9250865abf0ea461f215b128470636d072a6776821efef3caf5a7b992fb9","src/backend/stream.rs":"8fcbc20908ada4ccbf635704d1ea1ef6a0f6b7d6c49a6fa9c00659ff65c7abb1","src/capi.rs":"b2c1be8128cadd36caa65c80950440f9d6f2aa0c24cc7bae6a9eaf6347ac454d","src/lib.rs":"7282560d84b134b09acfd8d6282600982e42fb3557f72454c535637cc26c7bf6"},"package":null}
\ No newline at end of file
+{"files":{".editorconfig":"bf047bd1da10cabb99eea666d1e57c321eba4716dccb3e4ed0e2c5fe3ca53858",".travis.yml":"0394e2adb041175457685cde5ee05ff04bdab8885fd8a62551f2ff43d9e48872","AUTHORS":"0e0ac930a68ce2f6b876126b195add177f0d3886facb9260f4d9b69f1988f0cc","Cargo.toml":"297f0144bbebcbc2f3b5478fed750f39adb3b60f9d6c273dfa72d9736818423d","LICENSE":"44c6b5ae5ec3fe2fbc608b00e6f4896f4d2d5c7e525fcbaa3eaa3cf2f3d5a983","README.md":"e6a98ee5630b9ce1a096a2907d095454f2770e298a5b0976ab552cc53ca96cfc","src/backend/context.rs":"33d9fdf1504fe1ae43d301e288daf6eaeabeb47aa0ef86efa135c6d984425fc4","src/backend/cork_state.rs":"4a0f1afc7d9f333dac89218cc56d7d32fbffb487cd48c1c9a4e03d79cb3b5e28","src/backend/intern.rs":"374a9a3bd79fddc47739dda1dbfc5929aea5a91946794fe65fba3c8d130fbda9","src/backend/mod.rs":"06ce9250865abf0ea461f215b128470636d072a6776821efef3caf5a7b992fb9","src/backend/stream.rs":"9f29e85927b670bdb9943cea2c7dc424dad2c3129949542480992ad125c7485f","src/capi.rs":"b2c1be8128cadd36caa65c80950440f9d6f2aa0c24cc7bae6a9eaf6347ac454d","src/lib.rs":"7282560d84b134b09acfd8d6282600982e42fb3557f72454c535637cc26c7bf6"},"package":null}
\ No newline at end of file
--- a/third_party/rust/cubeb-pulse/src/backend/stream.rs
+++ b/third_party/rust/cubeb-pulse/src/backend/stream.rs
@@ -382,23 +382,30 @@ impl<'ctx> PulseStream<'ctx> {
                         let battr = pa_buffer_attr {
                             maxlength: u32::max_value(),
                             prebuf: u32::max_value(),
                             fragsize: u32::max_value(),
                             tlength: buffer_size_bytes * 2,
                             minreq: buffer_size_bytes / 4
                         };
                         let device_name = super::try_cstr_from(output_device as *const _);
+                        let mut stream_flags = pulse::StreamFlags::AUTO_TIMING_UPDATE
+                            | pulse::StreamFlags::INTERPOLATE_TIMING
+                            | pulse::StreamFlags::START_CORKED
+                            | pulse::StreamFlags::ADJUST_LATENCY;
+                        if device_name.is_some()
+                            || stream_params
+                                .prefs()
+                                .contains(StreamPrefs::DISABLE_DEVICE_SWITCHING) {
+                          stream_flags |= pulse::StreamFlags::DONT_MOVE;
+                        }
                         let _ = s.connect_playback(
                             device_name,
                             &battr,
-                            pulse::StreamFlags::AUTO_TIMING_UPDATE
-                                | pulse::StreamFlags::INTERPOLATE_TIMING
-                                | pulse::StreamFlags::START_CORKED
-                                | pulse::StreamFlags::ADJUST_LATENCY,
+                            stream_flags,
                             None,
                             None,
                         );
 
                         stm.output_stream = Some(s);
                     }
                     Err(e) => {
                         stm.context.mainloop.unlock();
@@ -421,23 +428,30 @@ impl<'ctx> PulseStream<'ctx> {
                         let battr = pa_buffer_attr {
                             maxlength: u32::max_value(),
                             prebuf: u32::max_value(),
                             fragsize: buffer_size_bytes,
                             tlength: buffer_size_bytes,
                             minreq: buffer_size_bytes
                         };
                         let device_name = super::try_cstr_from(input_device as *const _);
+                        let mut stream_flags = pulse::StreamFlags::AUTO_TIMING_UPDATE
+                            | pulse::StreamFlags::INTERPOLATE_TIMING
+                            | pulse::StreamFlags::START_CORKED
+                            | pulse::StreamFlags::ADJUST_LATENCY;
+                        if device_name.is_some()
+                            || stream_params
+                                .prefs()
+                                .contains(StreamPrefs::DISABLE_DEVICE_SWITCHING) {
+                            stream_flags |= pulse::StreamFlags::DONT_MOVE;
+                        }
                         let _ = s.connect_record(
                             device_name,
                             &battr,
-                            pulse::StreamFlags::AUTO_TIMING_UPDATE
-                                | pulse::StreamFlags::INTERPOLATE_TIMING
-                                | pulse::StreamFlags::START_CORKED
-                                | pulse::StreamFlags::ADJUST_LATENCY,
+                            stream_flags,
                         );
 
                         stm.input_stream = Some(s);
                     }
                     Err(e) => {
                         stm.context.mainloop.unlock();
                         stm.destroy();
                         return Err(e);