Skip to content

Commit

Permalink
fix deadlock when creating VideoStream and AudioStream (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
theomonnom authored Dec 7, 2023
1 parent 5724740 commit d6f7512
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion livekit-ffi/src/server/audio_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ impl FfiAudioStream {
server: &'static server::FfiServer,
new_stream: proto::NewAudioStreamRequest,
) -> FfiResult<proto::OwnedAudioStream> {
let ffi_track = server.retrieve_handle::<FfiTrack>(new_stream.track_handle)?;
let ffi_track = server
.retrieve_handle::<FfiTrack>(new_stream.track_handle)?
.clone();
let rtc_track = ffi_track.track.rtc_track();

let MediaStreamTrack::Audio(rtc_track) = rtc_track else {
Expand Down
4 changes: 3 additions & 1 deletion livekit-ffi/src/server/video_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ impl FfiVideoStream {
server: &'static server::FfiServer,
new_stream: proto::NewVideoStreamRequest,
) -> FfiResult<proto::OwnedVideoStream> {
let ffi_track = server.retrieve_handle::<FfiTrack>(new_stream.track_handle)?;
let ffi_track = server
.retrieve_handle::<FfiTrack>(new_stream.track_handle)?
.clone();
let rtc_track = ffi_track.track.rtc_track();

let MediaStreamTrack::Video(rtc_track) = rtc_track else {
Expand Down

0 comments on commit d6f7512

Please sign in to comment.