opt: remove latency detector on single audio

This commit is contained in:
Kingtous
2023-01-29 14:10:06 +08:00
parent 8e2d6945d0
commit 45a6fc3618
3 changed files with 19 additions and 1 deletions

View File

@@ -171,6 +171,8 @@ impl Connection {
let tx_cloned = tx.clone();
// 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_enabled(false);
let audio_sender = start_audio_thread(Some(latency_controller));
let mut conn = Self {
inner: ConnInner {
@@ -1561,7 +1563,7 @@ impl Connection {
_ => {}
},
Some(message::Union::AudioFrame(frame)) => {
if !self.disable_audio {
if !self.disable_audio {
allow_err!(self.audio_sender.send(MediaData::AudioFrame(frame)));
}
}