diff --git a/src/rtsp/gst/server.rs b/src/rtsp/gst/server.rs index 2a24280..6109145 100644 --- a/src/rtsp/gst/server.rs +++ b/src/rtsp/gst/server.rs @@ -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>(&self, tag: T) -> AnyResult<()> { if let Some(sender) = self.imp().get_sender(tag).await { sender.send(FactoryCommand::ClearBuffer).await?; diff --git a/src/rtsp/mod.rs b/src/rtsp/mod.rs index 4d9295e..9733008 100644 --- a/src/rtsp/mod.rs +++ b/src/rtsp/mod.rs @@ -185,11 +185,15 @@ async fn camera_main(camera: Camera) -> Result<(), CameraFailureKi let rtsp_thread = loggedin.get_rtsp(); // Clear all buffers present - tags.iter() - .map(|tag| rtsp_thread.clear_buffer(tag)) - .collect::>() - .collect::>() - .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::>() + // .collect::>() + // .await; // Start pulling data from the camera let mut streaming = loggedin