From 02d06562a67d9bc8f3a7ab7710d306f0ea594437 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 5 Mar 2026 10:43:20 +0100 Subject: [PATCH] Don't reset decoders if there's no change --- client/scenes/stream.cpp | 4 +++- common/wivrn_packets.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index cb4f3e5c..543d785a 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -1137,8 +1137,10 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript { session.set_refresh_rate(description.fps); - spdlog::info("Creating decoders, size {}x{}", description.width, description.height); std::unique_lock lock(decoder_mutex); + if (video_stream_description == description) + return; + spdlog::info("Creating decoders, size {}x{}", description.width, description.height); video_stream_description = description; for (const auto & [stream_index, item]: utils::enumerate(decoders)) diff --git a/common/wivrn_packets.h b/common/wivrn_packets.h index 1a814e31..14c6c918 100644 --- a/common/wivrn_packets.h +++ b/common/wivrn_packets.h @@ -659,6 +659,8 @@ struct video_stream_description uint16_t height; std::array codec; // left, right, alpha float fps; + + bool operator==(const video_stream_description &) const = default; }; class video_stream_data_shard