Skip to content

Commit

Permalink
refactor: select layer lock
Browse files Browse the repository at this point in the history
  • Loading branch information
hongcha98 committed Dec 22, 2023
1 parent 8456b97 commit 3b172dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/forward/forward_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,15 @@ impl PeerForwardInternal {
if track_remote_original.0.kind() != RTPCodecType::Video {
continue;
}
let mut subscription_group =
track_forward_original.subscription_group.write().await;
let subscription_group =
track_forward_original.subscription_group.read().await;
if subscription_group.contains_key(&peer) {
if track_remote_original.0.rid() == rid {
return Ok(());
}
drop(subscription_group);
let mut subscription_group =
track_forward_original.subscription_group.write().await;
let sender = subscription_group.remove(&peer).unwrap();
drop(subscription_group);
track_forward
Expand Down

0 comments on commit 3b172dc

Please sign in to comment.