mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-11 03:10:49 +08:00
drm: switch for a new subscriber once the encoder has run
Nothing is sent in the WouldBlock arm, so the switch is needed only when the encoder already produced frames, even if the subscribers that got them are gone: otherwise the new one gets no keyframe until the screen changes. A fresh encoder needs no switch. Log the expected event at trace level.
This commit is contained in:
1 parent
de139dc972
commit
ea73ed51ff
1 file changed
+7
-5
@@ -900,12 +900,14 @@ 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. Nothing
|
||||
// is sent here, so switch even when the old subscribers are gone.
|
||||
// Nothing is sent here: a subscriber added without a refresh needs the switch once
|
||||
// the encoder has run, even if its old subscribers left; a fresh encoder needs none.
|
||||
sp.snapshot(|_| {
|
||||
log::trace!("switch due to new subscriber");
|
||||
bail!("SWITCH");
|
||||
if !first_frame {
|
||||
log::trace!("switch due to new subscriber");
|
||||
bail!("SWITCH");
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
#[cfg(windows)]
|
||||
if dxgi_recovery_started
|
||||
|
||||
Reference in new issue
Block a user