More checks for live appsrc
This commit is contained in:
3 files changed
+11
-5
No files matched your search
@@ -401,7 +401,7 @@ impl UdpPayloadInner {
|
||||
Ok(())
|
||||
} => v,
|
||||
};
|
||||
log::debug!("UdpPayloadInner::new SendToSocket Cancel");
|
||||
log::debug!("UdpPayloadInner::new SendToSocket Cancel: {:?}", result);
|
||||
send_cancel.cancel();
|
||||
result
|
||||
});
|
||||
|
||||
+4
-3
@@ -258,7 +258,7 @@ async fn listen_on_camera(camera: NeoInstance, mqtt_instance: MqttInstance) -> R
|
||||
let mut config;
|
||||
let cancel = CancellationToken::new();
|
||||
let drop_cancel = cancel.clone().drop_guard();
|
||||
loop {
|
||||
let r = loop {
|
||||
config = watch_config.borrow().clone().mqtt;
|
||||
break tokio::select! {
|
||||
v = watch_config.wait_for(|new_config| config != new_config.mqtt) => {
|
||||
@@ -545,10 +545,11 @@ async fn listen_on_camera(camera: NeoInstance, mqtt_instance: MqttInstance) -> R
|
||||
AnyResult::Ok(())
|
||||
} => v,
|
||||
};
|
||||
}?;
|
||||
};
|
||||
|
||||
log::debug!("Mqtt::listen_on_camera Cancel");
|
||||
log::debug!("Mqtt::listen_on_camera Cancel: {r:?}");
|
||||
drop(drop_cancel);
|
||||
r?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -439,7 +439,12 @@ async fn stream_run(
|
||||
|
||||
fn check_live(app: &AppSrc) -> Result<()> {
|
||||
// log::debug!("Checking Live: {:?}", app.bus());
|
||||
app.bus().map(|_| ()).ok_or(anyhow!("App source is closed"))
|
||||
app.bus().ok_or(anyhow!("App source is closed"))?;
|
||||
app.pads()
|
||||
.iter()
|
||||
.all(|pad| pad.is_linked())
|
||||
.then_some(())
|
||||
.ok_or(anyhow!("App source is closed"))
|
||||
}
|
||||
|
||||
fn get_runtime(app: &AppSrc) -> Option<Duration> {
|
||||
|
||||
Reference in new issue
Block a user