From dfa8ca211d857bd56ebf9f8eaf9ae2c523a59474 Mon Sep 17 00:00:00 2001 From: notedit Date: Sun, 12 Jan 2020 21:10:10 +0800 Subject: [PATCH] fix Former-commit-id: e4ce74fc7cea9a9b8de8fba159246591676ee4a8 [formerly 56527a312290e9038ba3abc7679729d8900e3121] [formerly c8ba9070783205bc9a74040222f3ea8136979689 [formerly d45c4f513df86c4061a0f8da0c0c72b16047ff87]] Former-commit-id: d0f3e222892a45ca12017b55754ae0188e005c4a [formerly 54da6d72716a8a76d1b461d91e3f14420dd5d4d7] Former-commit-id: b4c47ae79c49e3c4e18d07957de0c3d0358ccdc2 --- incomingstream.go | 13 ++++++------- outgoingstream.go | 7 +++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/incomingstream.go b/incomingstream.go index 91a45b2..6a7329b 100644 --- a/incomingstream.go +++ b/incomingstream.go @@ -3,7 +3,6 @@ package mediaserver import ( "errors" "fmt" - "runtime" "strconv" "strings" "sync" @@ -212,9 +211,9 @@ func (i *IncomingStream) CreateTrack(track *sdp.TrackInfo) *IncomingStreamTrack i.transport.AddIncomingSourceGroup(source) sources[rid] = source - runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { - i.transport.RemoveIncomingSourceGroup(source) - }) + // runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { + // i.transport.RemoveIncomingSourceGroup(source) + // }) } } @@ -251,9 +250,9 @@ func (i *IncomingStream) CreateTrack(track *sdp.TrackInfo) *IncomingStreamTrack sources[strconv.Itoa(j)] = source - runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { - i.transport.RemoveIncomingSourceGroup(source) - }) + // runtime.SetFinalizer(source, func(source native.RTPIncomingSourceGroup) { + // i.transport.RemoveIncomingSourceGroup(source) + // }) } } else { diff --git a/outgoingstream.go b/outgoingstream.go index eac1d43..53d2a90 100644 --- a/outgoingstream.go +++ b/outgoingstream.go @@ -1,7 +1,6 @@ package mediaserver import ( - "runtime" "strings" "sync" @@ -217,9 +216,9 @@ func (o *OutgoingStream) CreateTrack(track *sdp.TrackInfo) *OutgoingStreamTrack outgoingTrack := newOutgoingStreamTrack(track.GetMedia(), track.GetID(), native.TransportToSender(o.transport), source) - runtime.SetFinalizer(source, func(source native.RTPOutgoingSourceGroup) { - o.transport.RemoveOutgoingSourceGroup(source) - }) + // runtime.SetFinalizer(source, func(source native.RTPOutgoingSourceGroup) { + // o.transport.RemoveOutgoingSourceGroup(source) + // }) o.Lock() o.tracks[outgoingTrack.GetID()] = outgoingTrack