Browse Source

fix bug that prevented multiple readers from accessing the same stream (#2281) (#2282)

pull/2283/head v1.0.3
Alessandro Ros 2 years ago committed by GitHub
parent
commit
ffa34428fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      internal/core/webrtc_outgoing_track.go
  2. 3
      internal/stream/stream_format.go

4
internal/core/webrtc_outgoing_track.go

@ -363,7 +363,5 @@ func (t *webRTCOutgoingTrack) start( @@ -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
internal/stream/stream_format.go

@ -80,8 +80,9 @@ func (sf *streamFormat) writeUnit(s *Stream, medi *description.Media, u unit.Uni @@ -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)
})
}
}

Loading…
Cancel
Save