pion / mediadevices

Go implementation of the MediaDevices API.
https://pion.ly/
MIT License
521 stars 120 forks source link

Closing media track causes panic #457

Closed naveenrobo closed 1 year ago

naveenrobo commented 1 year ago

Closing media track causes panic

This is my code

for _, track := range s.GetAudioTracks() {
            fmt.Println("Track is ", track.ID())
             track.Close()
        }

Output

panic: close of nil channel

goroutine 83 [running]:
github.com/pion/mediadevices.(*baseTrack).bind.func1.1()
        C:/Users/navee/go/pkg/mod/github.com/pion/mediadevices@v0.3.11/track.go:190 +0x5a
github.com/pion/mediadevices.(*baseTrack).bind.func1()
        C:/Users/navee/go/pkg/mod/github.com/pion/mediadevices@v0.3.11/track.go:211 +0x165
created by github.com/pion/mediadevices.(*baseTrack).bind
        C:/Users/navee/go/pkg/mod/github.com/pion/mediadevices@v0.3.11/track.go:186 +0x32c

Your environment.