From 41be071b605d60c5bfb6806d2b3674737e135ff9 Mon Sep 17 00:00:00 2001 From: Del Wang Date: Wed, 31 Dec 2025 18:43:29 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"chore:=20=E4=BF=AE=E6=94=B9=E9=97=B4?= =?UTF-8?q?=E9=9A=94"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0c8fbafd3f125ce21a44365d0dda45e15fd4b642. --- apps/hello/src/stereo_core/mixer.rs | 4 ++-- apps/hello/src/stereo_core/slave.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/hello/src/stereo_core/mixer.rs b/apps/hello/src/stereo_core/mixer.rs index 11a082b..180d81d 100644 --- a/apps/hello/src/stereo_core/mixer.rs +++ b/apps/hello/src/stereo_core/mixer.rs @@ -70,7 +70,7 @@ impl Mixer { if clients.is_empty() { drop(clients); // 没有客户端时,稍微等待,避免空转 - tokio::time::sleep(tokio::time::Duration::from_millis(10)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(1)).await; continue; } @@ -117,7 +117,7 @@ impl Mixer { } else { // 如果所有客户端都断开了,继续等待新连接 drop(clients); - tokio::time::sleep(tokio::time::Duration::from_millis(10)).await; + tokio::time::sleep(tokio::time::Duration::from_millis(1)).await; } } } diff --git a/apps/hello/src/stereo_core/slave.rs b/apps/hello/src/stereo_core/slave.rs index a95122f..d29cb50 100644 --- a/apps/hello/src/stereo_core/slave.rs +++ b/apps/hello/src/stereo_core/slave.rs @@ -184,7 +184,7 @@ async fn handle_connection(role: ChannelRole) -> Result<()> { let len = codec.decode(&data, &mut pcm_buf)?; player.write(&pcm_buf[..len])?; } else { - tokio::time::sleep(Duration::from_millis(10)).await; + tokio::time::sleep(Duration::from_millis(1)).await; } } }