Skip to content

Commit

Permalink
fix(dgw): send close code 1005 when video streaming ends (#1186)
Browse files Browse the repository at this point in the history
Changelog: ignore
  • Loading branch information
irvingoujAtDevolution authored Jan 14, 2025
1 parent 8b3118a commit 74625c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/video-streamer/src/streamer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub(crate) mod signal_writer;
pub(crate) mod tag_writers;

use crate::{reopenable::Reopenable, StreamingConfig};
use tokio::io::AsyncWriteExt;

#[instrument(skip_all)]
pub fn webm_stream(
Expand Down Expand Up @@ -226,6 +227,7 @@ fn spawn_sending_task<W>(
},
}
}
let _ = ws_frame.lock().await.get_mut().shutdown().await;
Ok::<_, anyhow::Error>(())
});

Expand All @@ -249,6 +251,7 @@ fn spawn_sending_task<W>(
}
}
info!("Stopping streaming task");
let _ = ws_frame_clone.lock().await.get_mut().shutdown().await;
handle.abort();
stop_notifier.notify_waiters();
Ok::<_, anyhow::Error>(())
Expand Down

0 comments on commit 74625c4

Please sign in to comment.