public override void Stop() { tok.Cancel(); VideoThread?.CloseSocket(); AudioThread?.CloseSocket(); VideoThread?.Join(); AudioThread?.Join(); base.Stop(); }
public void ResetDevices() { // kill thread if (AudioThread != null) { ThreadRunning = false; AudioEvent.Set(); AudioThread.Join(2000); AudioThread = null; } // deconstruct all record/play streams if (Recorder != null) { Recorder.Dispose(); Recorder = null; } Players.ForEach(p => p.Dispose()); Players.SafeClear(); // will auto be recreated }