Do not mute when stream is paused. (#2069)

This commit is contained in:
Raja Subramanian
2023-09-13 19:59:24 +05:30
committed by GitHub
parent a55c50f61d
commit 68aebb0106
5 changed files with 135 additions and 70 deletions
@@ -515,6 +515,18 @@ func (s *StreamAllocator) IsBWEEnabled(downTrack *sfu.DownTrack) bool {
return true
}
// called to check if track subscription mute can be applied
func (s *StreamAllocator) IsSubscribeMutable(downTrack *sfu.DownTrack) bool {
s.videoTracksMu.Lock()
defer s.videoTracksMu.Unlock()
if track := s.videoTracks[livekit.TrackID(downTrack.ID())]; track != nil {
return track.IsSubscribeMutable()
}
return true
}
func (s *StreamAllocator) maybePostEventAllocateTrack(downTrack *sfu.DownTrack) {
shouldPost := false
s.videoTracksMu.Lock()
+4
View File
@@ -101,6 +101,10 @@ func (t *Track) SetStreamState(streamState StreamState) bool {
return true
}
func (t *Track) IsSubscribeMutable() bool {
return t.streamState != StreamStatePaused
}
func (t *Track) SetPriority(priority uint8) bool {
if priority == 0 {
switch t.source {