diff --git a/incomingstream.go b/incomingstream.go index 963f8f9..91a45b2 100644 --- a/incomingstream.go +++ b/incomingstream.go @@ -281,9 +281,6 @@ func (i *IncomingStream) CreateTrack(track *sdp.TrackInfo) *IncomingStreamTrack // Append to soruces with empty rid sources[""] = source - runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { - i.transport.RemoveIncomingSourceGroup(source) - }) } incomingTrack := NewIncomingStreamTrack(track.GetMedia(), track.GetID(), i.receiver, sources) diff --git a/transport.go b/transport.go index f587361..9d550aa 100644 --- a/transport.go +++ b/transport.go @@ -2,7 +2,6 @@ package mediaserver import ( "fmt" - "runtime" "sync" "github.com/gofrs/uuid" @@ -460,10 +459,6 @@ func (t *Transport) CreateOutgoingStreamTrack(media string, trackId string, ssrc outgoingTrack := newOutgoingStreamTrack(media, trackId, native.TransportToSender(t.transport), source) - runtime.SetFinalizer(source, func(source native.RTPOutgoingSourceGroup) { - t.transport.RemoveOutgoingSourceGroup(source) - }) - for _, trackFunc := range t.onOutgoingTrackListeners { trackFunc(outgoingTrack, nil) } @@ -526,10 +521,6 @@ func (t *Transport) CreateIncomingStreamTrack(media string, trackId string, ssrc incomingTrack := NewIncomingStreamTrack(media, trackId, native.TransportToReceiver(t.transport), sources) - runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { - t.transport.RemoveIncomingSourceGroup(source) - }) - for _, trackFunc := range t.onIncomingTrackListeners { trackFunc(incomingTrack, nil) } diff --git a/transport_test.go b/transport_test.go index 96008d0..bd48eba 100644 --- a/transport_test.go +++ b/transport_test.go @@ -208,7 +208,6 @@ func Test_TransportCreateStream(t *testing.T) { fmt.Println(incoming) - //incoming.Stop() transport.Stop() } diff --git a/wrapper/module.go b/wrapper/module.go index 1211638..28aa438 100644 --- a/wrapper/module.go +++ b/wrapper/module.go @@ -10,6 +10,7 @@ package native #cgo CPPFLAGS: -I${SRCDIR}/../include/media-server/src/ #cgo LDFLAGS: -L/usr/local/lib -lmediaserver -lssl -lcrypto -lsrtp2 #cgo LDFLAGS: /usr/local/lib/libmp4v2.a +#cgo LDFLAGS: /usr/local/lib/libsrtp2.a #cgo LDFLAGS: -ldl */ import "C"