try to fix audio play noise;improve audio performance

This commit is contained in:
csf
2022-02-22 20:45:49 +08:00
parent 4a03c60ac1
commit 82d5924401
5 changed files with 45 additions and 19 deletions

View File

@@ -400,6 +400,20 @@ where
}
}
}
pub async fn send_raw(&mut self, data: Vec<u8>) -> ResultType<()> {
self.inner.send(bytes::Bytes::from(data)).await?;
Ok(())
}
pub async fn next_raw(&mut self) -> ResultType<bytes::BytesMut> {
match self.inner.next().await {
Some(Ok(res)) => Ok(res),
_ => {
bail!("reset by the peer");
}
}
}
}
#[tokio::main(flavor = "current_thread")]