mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-11 03:10:49 +08:00
drm: switch for any new subscriber on a still screen
In the WouldBlock arm nothing is sent after the check, so also switch when the last active subscriber has left and a new one is pending: the snapshot would promote it with no frame ever following. Log the expected event at trace level.
This commit is contained in:
1 parent
fd872773b4
commit
de139dc972
1 file changed
+5
-7
@@ -901,13 +901,11 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
match res {
|
||||
Err(ref e) if e.kind() == WouldBlock => {
|
||||
// A still screen may never reach handle_one_frame, which is where a subscriber
|
||||
// added without a refresh (mobile display switch) is otherwise noticed.
|
||||
sp.snapshot(|sps| {
|
||||
if sps.has_subscribes() {
|
||||
log::info!("switch due to new subscriber");
|
||||
bail!("SWITCH");
|
||||
}
|
||||
Ok(())
|
||||
// added without a refresh (mobile display switch) is otherwise noticed. Nothing
|
||||
// is sent here, so switch even when the old subscribers are gone.
|
||||
sp.snapshot(|_| {
|
||||
log::trace!("switch due to new subscriber");
|
||||
bail!("SWITCH");
|
||||
})?;
|
||||
#[cfg(windows)]
|
||||
if dxgi_recovery_started
|
||||
|
||||
Reference in new issue
Block a user