fix: unsubscribe deadlock (#101)
This commit is contained in:
@@ -182,7 +182,8 @@ impl RemoteParticipant {
|
||||
}
|
||||
|
||||
// remove tracks that are no longer valid
|
||||
for (sid, _) in self.inner.tracks.read().iter() {
|
||||
let tracks = self.inner.tracks.read().clone();
|
||||
for (sid, _) in &tracks {
|
||||
if valid_tracks.contains(sid) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ impl RemoteTrackPublication {
|
||||
remote: Arc::new(RemoteInner {
|
||||
info: RwLock::new(RemoteInfo {
|
||||
subscribed: false,
|
||||
allowed: false,
|
||||
allowed: true,
|
||||
}),
|
||||
events: Default::default(),
|
||||
}),
|
||||
@@ -122,7 +122,12 @@ impl RemoteTrackPublication {
|
||||
}
|
||||
|
||||
pub(crate) fn update_info(&self, info: proto::TrackInfo) {
|
||||
super::update_info(&self.inner, &TrackPublication::Remote(self.clone()), info);
|
||||
super::update_info(
|
||||
&self.inner,
|
||||
&TrackPublication::Remote(self.clone()),
|
||||
info.clone(),
|
||||
);
|
||||
self.inner.info.write().muted = info.muted;
|
||||
}
|
||||
|
||||
pub(crate) fn on_muted(&self, f: impl Fn(TrackPublication, Track) + Send + 'static) {
|
||||
|
||||
Reference in New Issue
Block a user