mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Fix realtime test server helper imports
Use the workspace opus crate name directly and clone the request sender before moving it into the data-channel callback so the RTP track handler can still enqueue decoded packets. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -47,7 +47,3 @@ zstd = { workspace = true }
|
||||
[dev-dependencies]
|
||||
pretty_assertions = { workspace = true }
|
||||
reqwest = { workspace = true }
|
||||
|
||||
[package.metadata.cargo-shear]
|
||||
# Imported as `audiopus` from Rust code, but declared as `opus` in workspace deps.
|
||||
ignored = ["opus"]
|
||||
|
||||
@@ -3,10 +3,10 @@ use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use std::time::Duration;
|
||||
|
||||
use audiopus::Channels;
|
||||
use audiopus::coder::Decoder as OpusDecoder;
|
||||
use base64::Engine;
|
||||
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
|
||||
use opus::Channels;
|
||||
use opus::Decoder as OpusDecoder;
|
||||
use serde_json::Value;
|
||||
use tokio::io::AsyncReadExt;
|
||||
use tokio::io::AsyncWriteExt;
|
||||
@@ -202,9 +202,10 @@ async fn start_session(
|
||||
let (tx_request, rx_request) = mpsc::unbounded_channel::<Value>();
|
||||
let (tx_data_channel, rx_data_channel) = oneshot::channel::<Arc<RTCDataChannel>>();
|
||||
let tx_data_channel = Mutex::new(Some(tx_data_channel));
|
||||
let tx_data_channel_request = tx_request.clone();
|
||||
|
||||
peer_connection.on_data_channel(Box::new(move |data_channel| {
|
||||
let tx_request = tx_request.clone();
|
||||
let tx_request = tx_data_channel_request.clone();
|
||||
if let Ok(mut tx_data_channel) = tx_data_channel.lock()
|
||||
&& let Some(tx_data_channel) = tx_data_channel.take()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user