From 3f39fa1f6f6beed404b44bf84f0767e0774071c2 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 | 4 ++++ src/format.rs | 10 +++++++++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f0c30c8c..92b48d24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -521,7 +521,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 951f8368..d540d035 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 8d82c4d1..65e7ea38 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,6 +2,10 @@ - Add support for wp-alpha-modifier. +# 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 }