pion / mediadevices

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

Properly close microphone before malgo chunk channel #436

Closed edaniels closed 1 year ago

edaniels commented 1 year ago

Prior to this, there's a chance you would close the chunk channel while malgo is trying to send on it. Instead, it's better to stop the malgo device and then close. That also means we need to discard chunks when trying to stop due to the buffered channel.

edaniels commented 1 year ago

@at-wat updated. I left the intentional close in to not rely on an GC implementation detail

codecov[bot] commented 1 year ago

Codecov Report

Merging #436 (dcaf53c) into master (5215057) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #436   +/-   ##
=======================================
  Coverage   47.32%   47.32%           
=======================================
  Files          67       67           
  Lines        4463     4463           
=======================================
  Hits         2112     2112           
  Misses       2226     2226           
  Partials      125      125           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.