Avoid double boxing of oneshot when calling LKRoomPublishVideoTrack
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
b154c3c9ee
commit
376e674748
1 changed files with 1 additions and 6 deletions
|
@ -61,12 +61,7 @@ impl Room {
|
||||||
pub fn publish_video_track(&self, track: &LocalVideoTrack) -> impl Future<Output = Result<()>> {
|
pub fn publish_video_track(&self, track: &LocalVideoTrack) -> impl Future<Output = Result<()>> {
|
||||||
let (did_publish, tx, rx) = Self::build_done_callback();
|
let (did_publish, tx, rx) = Self::build_done_callback();
|
||||||
unsafe {
|
unsafe {
|
||||||
LKRoomPublishVideoTrack(
|
LKRoomPublishVideoTrack(self.0, track.0, did_publish, tx);
|
||||||
self.0,
|
|
||||||
track.0,
|
|
||||||
did_publish,
|
|
||||||
Box::into_raw(Box::new(tx)) as *mut c_void,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
async { rx.await.unwrap().context("error publishing video track") }
|
async { rx.await.unwrap().context("error publishing video track") }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue