pion / mediadevices

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

Dead lock on closing Peer Connection while media device track running #336

Closed EmrysMyrddin closed 3 years ago

EmrysMyrddin commented 3 years ago

Your environment.

What did you do?

I have started a peer connection with a media device track sending camera video feed. Call Close method on the peer connection.

What did you expect?

Calling Close should close the connection as expected

What happened?

Calling Close causes a dead lock.

The reason of the dead lock is a double lock request on the same mutex by both the track closing code and the track error handling code.