This commit is contained in:
rustdesk
2023-03-23 14:31:50 +08:00
parent 0ea7019a16
commit b763ec3080
8 changed files with 20 additions and 147 deletions

View File

@@ -13,7 +13,6 @@
// https://github.com/krruzic/pulsectl
use super::*;
use hbb_common::get_time;
use magnum_opus::{Application::*, Channels::*, Encoder};
use std::sync::atomic::{AtomicBool, Ordering};
@@ -349,7 +348,6 @@ 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: get_time(),
..Default::default()
});
sp.send(msg_out);
@@ -369,7 +367,6 @@ 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: get_time(),
..Default::default()
});
sp.send(msg_out);

View File

@@ -7,8 +7,7 @@ use crate::common::update_clipboard;
use crate::portable_service::client as portable_client;
use crate::{
client::{
new_voice_call_request, new_voice_call_response, start_audio_thread, LatencyController,
MediaData, MediaSender,
new_voice_call_request, new_voice_call_response, start_audio_thread, MediaData, MediaSender,
},
common::{get_default_sound_input, set_sound_input},
video_service,
@@ -843,15 +842,16 @@ impl Connection {
pi.hostname = DEVICE_NAME.lock().unwrap().clone();
pi.platform = "Android".into();
}
let mut platform_additions = serde_json::Map::new();
#[cfg(target_os = "linux")]
{
let mut platform_additions = serde_json::Map::new();
if crate::platform::current_is_wayland() {
platform_additions.insert("is_wayland".into(), json!(true));
}
}
if !platform_additions.is_empty() {
pi.platform_additions = serde_json::to_string(&platform_additions).unwrap_or("".into());
if !platform_additions.is_empty() {
pi.platform_additions =
serde_json::to_string(&platform_additions).unwrap_or("".into());
}
}
#[cfg(feature = "hwcodec")]
@@ -1612,11 +1612,7 @@ impl Connection {
if !self.disable_audio {
// Drop the audio sender previously.
drop(std::mem::replace(&mut self.audio_sender, None));
// Start a audio thread to play the audio sent by peer.
let latency_controller = LatencyController::new();
// No video frame will be sent here, so we need to disable latency controller, or audio check may fail.
latency_controller.lock().unwrap().set_audio_only(true);
self.audio_sender = Some(start_audio_thread(Some(latency_controller)));
self.audio_sender = Some(start_audio_thread());
allow_err!(self
.audio_sender
.as_ref()

View File

@@ -787,7 +787,6 @@ fn create_msg(vp9s: Vec<EncodedVideoFrame>) -> Message {
frames: vp9s.into(),
..Default::default()
});
vf.timestamp = hbb_common::get_time();
msg_out.set_video_frame(vf);
msg_out
}