Fix error handling and crash in case of unsupported codecs (fixes #10)
This commit is contained in:
parent
90b73796a5
commit
6b1d613d0e
2 changed files with 6 additions and 2 deletions
|
@ -97,7 +97,7 @@ class GlobalBindings {
|
|||
|
||||
this.client = client
|
||||
// Prepare for connection errors
|
||||
client.on('error', function (err) {
|
||||
client.on('error', (err) => {
|
||||
log('Connection error:', err)
|
||||
this.resetClient()
|
||||
})
|
||||
|
@ -279,7 +279,7 @@ class GlobalBindings {
|
|||
this.client.disconnect()
|
||||
}
|
||||
this.client = null
|
||||
this.thisUser(null).root(null).selected(null)
|
||||
this.selected(null).root(null).thisUser(null)
|
||||
}
|
||||
|
||||
this.connected = () => this.thisUser() != null
|
||||
|
@ -502,6 +502,9 @@ var resampler = new Resampler({
|
|||
|
||||
var voiceStream
|
||||
resampler.pipe(chunker(4 * 480)).on('data', function (data) {
|
||||
if (!ui.client) {
|
||||
voiceStream = null
|
||||
}
|
||||
if (!voiceStream && ui.client) {
|
||||
voiceStream = ui.client.createVoiceStream()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue