Skip to content

Commit

Permalink
Support more than 1 audio track at start
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Nov 23, 2024
1 parent df9029b commit 5136e42
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/config/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type SDKSourceParams struct {
TrackKind string
AudioInCodec types.MimeType
VideoInCodec types.MimeType
AudioTrack *TrackSource
AudioTracks []*TrackSource
VideoTrack *TrackSource
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/pipeline/builder/audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func (b *AudioBin) buildWebInput() error {
}

func (b *AudioBin) buildSDKInput() error {
if b.conf.AudioTrack != nil {
if err := b.addAudioAppSrcBin(b.conf.AudioTrack); err != nil {
for _, tr := range b.conf.AudioTracks {
if err := b.addAudioAppSrcBin(tr); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/source/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (s *SDKSource) onTrackSubscribed(track *webrtc.TrackRemote, pub *lksdk.Remo
s.mu.Unlock()

if !s.initialized.IsBroken() {
s.AudioTrack = ts
s.AudioTracks = append(s.AudioTracks, ts)
}

case types.MimeTypeH264, types.MimeTypeVP8, types.MimeTypeVP9:
Expand Down

0 comments on commit 5136e42

Please sign in to comment.