From 7123378c9082fed99d856dbc9bb9b19e7329a931 Mon Sep 17 00:00:00 2001 From: Renovate_Bot <group_5_bot_ff258b4c4911ba7eeabbc7fc63f69926@noreply.git.opentalk.dev> Date: Wed, 19 Feb 2025 09:49:51 +0000 Subject: [PATCH] fix(deps): update rust crate compositor to 0.14.0 --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/recorder.rs | 21 +++++++++------------ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56938eb..6bad6e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3695,9 +3695,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "opentalk-compositor" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c460d39514fd05e6eb7fad51d7375ff7bb5045c753c76759012e0be55c12c9" +checksum = "f3b946bcbbd753aed59d5690acada8b92e4422a8ce7f733b12b0d8d8005906e2" dependencies = [ "ab_glyph", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 847ac18..18dbf19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ build = "build.rs" [dependencies] anyhow = { version = "1", features = ["backtrace"] } bytes = "1" -compositor = { package = "opentalk-compositor", version = "0.13.1" } +compositor = { package = "opentalk-compositor", version = "0.14.0" } config = { version = "0.15", default-features = false, features = ["toml"] } env_logger = "0.11" futures = "0.3" diff --git a/src/recorder.rs b/src/recorder.rs index c09de2b..3eb7d7f 100644 --- a/src/recorder.rs +++ b/src/recorder.rs @@ -16,8 +16,8 @@ use std::{ use anyhow::{Context as ErrorContext, Result}; use bytes::Bytes; use compositor::{ - EncoderType, Mixer, MixerParameters, ParticipantIdentity, RTMPParameters, RTMPSink, SystemSink, - WebMParameters, WebMSink, + livekit::prelude::DisconnectReason, EncoderType, Mixer, MixerParameters, ParticipantIdentity, + RTMPParameters, RTMPSink, SystemSink, WebMParameters, WebMSink, }; use futures::Stream; use log::error; @@ -264,7 +264,7 @@ impl RecordingSession { } pub(crate) async fn run(&mut self) -> Result<()> { - async fn mixer_run(mixer: Option<&mut Mixer>) -> Result<()> { + async fn mixer_run(mixer: Option<&mut Mixer>) -> DisconnectReason { let Some(mixer) = mixer else { std::future::pending().await }; @@ -297,11 +297,9 @@ impl RecordingSession { self.done = true; break; } - result = mixer_run(self.mixer.as_mut()) => { - if let Err(err) = result { - log::error!("Running the mixer caused an error: {err:?}"); - break; - } + disconnect_reason = mixer_run(self.mixer.as_mut()) => { + log::error!("Disconnected from livekit: {disconnect_reason:?}"); + break; } chunk_limit_stream = chunk_limit_reached_rx.recv() => { let id = chunk_limit_stream?.id; @@ -558,7 +556,7 @@ impl RecordingSession { .. }) => { signaling::handle_left(&assoc_participant, &mut self.participants); - self.handle_participant_left(assoc_participant.id).await?; + self.handle_participant_left(assoc_participant.id)?; } ref other => { log::error!("Event {other:#?} not implemented for recorder."); @@ -749,7 +747,7 @@ impl RecordingSession { Ok(()) } - async fn handle_participant_left(&mut self, id: ParticipantId) -> Result<()> { + fn handle_participant_left(&mut self, id: ParticipantId) -> Result<()> { if self.participants.is_empty() { log::debug!("Last participant left the session. Stop recording."); self.done = true; @@ -766,8 +764,7 @@ impl RecordingSession { self.mixer .as_mut() .context("mixer does not exist")? - .remove_participant(&ParticipantIdentity::from(id.to_string())) - .await; + .remove_participant(&ParticipantIdentity::from(id.to_string())); Ok(()) } -- GitLab