Do not accept unsupported track type in AddTrack (#3530)

This commit is contained in:
Raja Subramanian authored and GitHub committed 2025-03-17 12:28:00 +05:30
1 parent 507fc9cf76
commit 188470a24b
1 file changed
+6 -1
+6 -1
View File
@@ -975,7 +975,12 @@ func (p *ParticipantImpl) handleMigrateTracks() []*MediaTrack {
// records track details and lets client know it's ok to proceed
func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest) {
if !p.CanPublishSource(req.Source) {
p.pubLogger.Warnw("no permission to publish track", nil)
p.pubLogger.Warnw("no permission to publish track", nil, "trackID", req.Sid, "kind", req.Type)
return
}
if req.Type != livekit.TrackType_AUDIO && req.Type != livekit.TrackType_VIDEO {
p.pubLogger.Warnw("unsupported track type", nil, "trackID", req.Sid, "kind", req.Type)
return
}