Restamp over clear buffer during reconnect

This commit is contained in:
QuantumEntangledAndy committed 2023-05-10 11:38:13 +07:00
1 parent e712e3b47c
commit d411e9c25b
2 files changed
+10 -5

No files matched your search

+1
View File
@@ -283,6 +283,7 @@ impl NeoRtspServer {
}
// Clear buffers on all senders of a tag
#[allow(dead_code)] // Old function, was used to clear buffer on reconnect
pub(crate) async fn clear_buffer<T: Into<String>>(&self, tag: T) -> AnyResult<()> {
if let Some(sender) = self.imp().get_sender(tag).await {
sender.send(FactoryCommand::ClearBuffer).await?;
+9 -5
View File
@@ -185,11 +185,15 @@ async fn camera_main(camera: Camera<Disconnected>) -> Result<(), CameraFailureKi
let rtsp_thread = loggedin.get_rtsp();
// Clear all buffers present
tags.iter()
.map(|tag| rtsp_thread.clear_buffer(tag))
.collect::<FuturesUnordered<_>>()
.collect::<Vec<_>>()
.await;
// Uncomment to clear buffers. This is now handlled in the buffer itself,
// instead of clearing it restamps it whenever there is a jump in the
// timestamps of >1s
//
// tags.iter()
// .map(|tag| rtsp_thread.clear_buffer(tag))
// .collect::<FuturesUnordered<_>>()
// .collect::<Vec<_>>()
// .await;
// Start pulling data from the camera
let mut streaming = loggedin