diff --git a/src/client.rs b/src/client.rs index 214af6cf7..e65c16f33 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1319,7 +1319,7 @@ impl LoginConfigHandler { self.conn_id = pi.conn_id; // no matter if change, for update file time self.save_config(config); - #[cfg(feature = "hwcodec")] + #[cfg(any(feature = "hwcodec", feature = "mediacodec"))] { self.supported_encoding = Some((pi.encoding.h264, pi.encoding.h265)); } diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 937c7e9cc..9e2a09545 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -146,10 +146,9 @@ impl Session { let decoder = scrap::codec::Decoder::video_codec_state(&self.id); let mut h264 = decoder.score_h264 > 0; let mut h265 = decoder.score_h265 > 0; - if let Some((encoding_264, encoding_265)) = self.lc.read().unwrap().supported_encoding { - h264 = h264 && encoding_264; - h265 = h265 && encoding_265; - } + let (encoding_264, encoding_265) = self.lc.read().unwrap().supported_encoding.unwrap_or_default(); + h264 = h264 && encoding_264; + h265 = h265 && encoding_265; return (h264, h265); } (false, false) @@ -1119,6 +1118,7 @@ impl Interface for Session { } fn handle_peer_info(&mut self, mut pi: PeerInfo) { + log::debug!("handle_peer_info :{:?}", pi); pi.username = self.lc.read().unwrap().get_username(&pi); if pi.current_display as usize >= pi.displays.len() { pi.current_display = 0;