Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Former-commit-id: e4ce74fc7cea9a9b8de8fba159246591676ee4a8 [formerly 56527a312290e9038ba3abc7679729d8900e3121] [formerly c8ba9070783205bc9a74040222f3ea8136979689 [formerly d45c4f5]]
Former-commit-id: d0f3e222892a45ca12017b55754ae0188e005c4a [formerly 54da6d72716a8a76d1b461d91e3f14420dd5d4d7]
Former-commit-id: b4c47ae79c49e3c4e18d07957de0c3d0358ccdc2
  • Loading branch information
notedit committed Jan 12, 2020
1 parent 91084ee commit dfa8ca2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
13 changes: 6 additions & 7 deletions incomingstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mediaserver
import (
"errors"
"fmt"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -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)
// })

}
}
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions outgoingstream.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mediaserver

import (
"runtime"
"strings"
"sync"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dfa8ca2

Please sign in to comment.