fix audio latency

This commit is contained in:
csf
2022-05-19 18:39:13 +08:00
parent 31a40538dc
commit a071eeb710
4 changed files with 58 additions and 5 deletions

View File

@@ -348,6 +348,7 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data,
timestamp: crate::common::get_time(),
..Default::default()
});
sp.send(msg_out);
@@ -367,10 +368,11 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data,
timestamp: crate::common::get_time(),
..Default::default()
});
sp.send(msg_out);
}
Err(_) => {}
}
}
}

View File

@@ -307,7 +307,7 @@ fn run(sp: GenericService) -> ResultType<()> {
*SWITCH.lock().unwrap() = true;
bail!("SWITCH");
}
#[cfg(windows)]
if !c.is_gdi() {
c.set_gdi();
@@ -341,6 +341,7 @@ fn create_msg(vp9s: Vec<VP9>) -> Message {
frames: vp9s.into(),
..Default::default()
});
vf.timestamp = crate::common::get_time();
msg_out.set_video_frame(vf);
msg_out
}