Skip to content

Commit

Permalink
Shut down the media stack when shutting down the constellation
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Nov 21, 2017
1 parent 17e97b9 commit 38fd964
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions components/constellation/Cargo.toml
Expand Up @@ -43,3 +43,6 @@ webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}

[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}

[target.'cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))'.dependencies]
gecko-media = {git = "https://github.com/servo/gecko-media.git"}
12 changes: 12 additions & 0 deletions components/constellation/constellation.rs
Expand Up @@ -108,6 +108,8 @@ use debugger;
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
use euclid::{Size2D, TypedSize2D, ScaleFactor};
use event_loop::EventLoop;
#[cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))]
use gecko_media::GeckoMedia;
use gfx::font_cache_thread::FontCacheThread;
use gfx_traits::Epoch;
use ipc_channel::{Error as IpcError};
Expand Down Expand Up @@ -1481,6 +1483,16 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>

debug!("Asking compositor to complete shutdown.");
self.compositor_proxy.send(ToCompositorMsg::ShutdownComplete);

#[cfg(all(
any(target_os = "macos", target_os = "linux"),
not(any(target_arch = "arm", target_arch = "aarch64")),
))]
{
if let Err(()) = GeckoMedia::shutdown() {
warn!("Media stack shutdown failed.");
}
}
}

fn handle_pipeline_exited(&mut self, pipeline_id: PipelineId) {
Expand Down
2 changes: 2 additions & 0 deletions components/constellation/lib.rs
Expand Up @@ -17,6 +17,8 @@ extern crate devtools_traits;
extern crate euclid;
#[cfg(all(not(target_os = "windows"), not(target_os = "ios")))]
extern crate gaol;
#[cfg(all(any(target_os = "macos", target_os = "linux"), not(any(target_arch = "arm", target_arch = "aarch64"))))]
extern crate gecko_media;
extern crate gfx;
extern crate gfx_traits;
extern crate hyper;
Expand Down

0 comments on commit 38fd964

Please sign in to comment.