From 6d4625641126ae74b4a6245b29cf808aa49a65fa Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 10 Apr 2024 18:56:26 +0200 Subject: [PATCH] portal: ignore formats not supported by pipewire --- Cargo.lock | 2 +- Cargo.toml | 2 +- deploy-notes.md | 4 ++++ release-notes.md | 6 +++++- src/format.rs | 10 +++++++++- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f9e62d9..5347e552 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -501,7 +501,7 @@ dependencies = [ [[package]] name = "jay-compositor" -version = "1.0.1" +version = "1.0.2" dependencies = [ "ahash", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index b52e9355..dd7a7776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jay-compositor" -version = "1.0.1" +version = "1.0.2" edition = "2021" build = "build/build.rs" license = "GPL-3.0-only" diff --git a/deploy-notes.md b/deploy-notes.md index bb6cc8d6..404a50d0 100644 --- a/deploy-notes.md +++ b/deploy-notes.md @@ -1,5 +1,9 @@ # Unreleased +# 1.0.2 + +- Needs jay-compositor release. + # 1.0 - Needs jay-config release. diff --git a/release-notes.md b/release-notes.md index fde5e974..7ac68354 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,9 @@ # Unreleased -# 1.0 +# 1.0.2 (2024-04-10) + +- Fixed a bug that caused the portal to fail. + +# 1.0 (2024-04-07) This is the first stable release of Jay. diff --git a/src/format.rs b/src/format.rs index bae6a760..45d9d179 100644 --- a/src/format.rs +++ b/src/format.rs @@ -71,11 +71,19 @@ static FORMATS_MAP: Lazy> = Lazy::new(|| { static PW_FORMATS_MAP: Lazy> = Lazy::new(|| { let mut map = AHashMap::new(); for format in FORMATS { - assert!(map.insert(format.pipewire, format).is_none()); + if format.pipewire != SPA_VIDEO_FORMAT_UNKNOWN { + assert!(map.insert(format.pipewire, format).is_none()); + } } map }); +#[test] +fn formats_dont_panic() { + formats(); + pw_formats(); +} + pub fn formats() -> &'static AHashMap { &FORMATS_MAP }