Skip to content

Commit

Permalink
fix bug that prevented multiple readers from accessing the same stream (
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Sep 1, 2023
1 parent 966bec8 commit ffa3442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions internal/core/webrtc_outgoing_track.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,5 @@ func (t *webRTCOutgoingTrack) start(
}
}()

stream.AddReader(writer, t.media, t.format, func(u unit.Unit) error {
return t.cb(u)
})
stream.AddReader(writer, t.media, t.format, t.cb)
}
3 changes: 2 additions & 1 deletion internal/stream/stream_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (sf *streamFormat) writeUnit(s *Stream, medi *description.Media, u unit.Uni
}

for writer, cb := range sf.readers {
ccb := cb
writer.Push(func() error {
return cb(u)
return ccb(u)
})
}
}
Expand Down

0 comments on commit ffa3442

Please sign in to comment.