fix audio no sound, add missing VideoFrame timestamp

move get_time to hbb_common

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-09-11 21:46:53 +08:00
parent 302a43d68c
commit 42d17f9d2b
8 changed files with 30 additions and 26 deletions

View File

@@ -13,6 +13,7 @@
// https://github.com/krruzic/pulsectl
use super::*;
use hbb_common::get_time;
use magnum_opus::{Application::*, Channels::*, Encoder};
use std::sync::atomic::{AtomicBool, Ordering};
@@ -348,7 +349,7 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data: data.into(),
timestamp: crate::common::get_time(),
timestamp: get_time(),
..Default::default()
});
sp.send(msg_out);
@@ -368,7 +369,7 @@ fn send_f32(data: &[f32], encoder: &mut Encoder, sp: &GenericService) {
let mut msg_out = Message::new();
msg_out.set_audio_frame(AudioFrame {
data: data.into(),
timestamp: crate::common::get_time(),
timestamp: get_time(),
..Default::default()
});
sp.send(msg_out);