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(
} }
}() }()
stream.AddReader(writer, t.media, t.format, func(u unit.Unit) error { stream.AddReader(writer, t.media, t.format, t.cb)
return t.cb(u)
})
} }

3
internal/stream/stream_format.go

@ -80,8 +80,9 @@ func (sf *streamFormat) writeUnit(s *Stream, medi *description.Media, u unit.Uni
} }
for writer, cb := range sf.readers { for writer, cb := range sf.readers {
ccb := cb
writer.Push(func() error { writer.Push(func() error {
return cb(u) return ccb(u)
}) })
} }
} }

Loading…
Cancel
Save