Skip to content

Commit

Permalink
check track prefix (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 authored Oct 7, 2024
1 parent a6ee73e commit 1257cc6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/pipeline/source/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ func (s *SDKSource) subscribeToTracks(expecting map[string]struct{}, deadline <-
for _, track := range p.TrackPublications() {
trackID := track.SID()
if _, ok := expecting[trackID]; ok {
if trackID == s.AudioTrackID && track.Kind() == lksdk.TrackKindVideo {
return nil, errors.ErrInvalidInput("audio_track_id")
} else if trackID == s.VideoTrackID && track.Kind() == lksdk.TrackKindAudio {
return nil, errors.ErrInvalidInput("video_track_id")
}

if err := s.subscribe(track); err != nil {
return nil, err
}
Expand Down

0 comments on commit 1257cc6

Please sign in to comment.