This commit is contained in:
rustdesk
2021-12-23 11:11:48 +08:00
parent 26a4b1f3eb
commit 252d3cb797
4 changed files with 19 additions and 20 deletions

View File

@@ -108,7 +108,7 @@ impl VideoFrameController {
fetched_conn_ids.insert(id);
// break if all connections have received current frame
if fetched_conn_ids.is_superset(&send_conn_ids) {
if fetched_conn_ids.len() >= send_conn_ids.len() {
break;
}
}
@@ -257,7 +257,7 @@ fn run(sp: GenericService) -> ResultType<()> {
Ok(frame) => {
let time = now - start;
let ms = (time.as_secs() * 1000 + time.subsec_millis() as u64) as i64;
let send_conn_ids = handle_one_frame(&sp, now, &frame, ms, &mut crc, &mut vpx)?;
let send_conn_ids = handle_one_frame(&sp, &frame, ms, &mut crc, &mut vpx)?;
frame_controller.set_send(now, send_conn_ids);
#[cfg(windows)]
{
@@ -327,7 +327,6 @@ fn create_frame(frame: &EncodeFrame) -> VP9 {
#[inline]
fn handle_one_frame(
sp: &GenericService,
now: Instant,
frame: &[u8],
ms: i64,
crc: &mut (u32, u32),
@@ -365,7 +364,7 @@ fn handle_one_frame(
// to-do: flush periodically, e.g. 1 second
if frames.len() > 0 {
send_conn_ids = sp.send_video_frame(now, create_msg(frames));
send_conn_ids = sp.send_video_frame(create_msg(frames));
}
}
Ok(send_conn_ids)