Do not instantiate 0 sized sequencer. (#3529)
This happens due to improper track type. One possible option is to check the mime type of the track and calculate the size, but there are other places in the code which work off provided track type. So, just doing a defensive fix. Have to review code for all uses of type and how it affects things if client provides incorrect type.
This commit is contained in:
@@ -113,6 +113,8 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, wr *
|
||||
case livekit.TrackType_VIDEO:
|
||||
rtcpFeedback = t.params.SubscriberConfig.RTCPFeedback.Video
|
||||
maxTrack = t.params.ReceiverConfig.PacketBufferSizeVideo
|
||||
default:
|
||||
t.params.Logger.Warnw("unexpected track type", nil, "kind", t.params.MediaTrack.Kind())
|
||||
}
|
||||
codecs := wr.Codecs()
|
||||
for _, c := range codecs {
|
||||
|
||||
@@ -119,6 +119,10 @@ type sequencer struct {
|
||||
}
|
||||
|
||||
func newSequencer(size int, maybeSparse bool, logger logger.Logger) *sequencer {
|
||||
if size == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
s := &sequencer{
|
||||
size: size,
|
||||
startTime: time.Now().UnixNano(),
|
||||
|
||||
Reference in New Issue
Block a user