Treat audio errors as unrecoverable errors

This commit is contained in:
Nonoo 2020-10-20 19:48:24 +02:00
parent 0678ac84bb
commit 3c22b401e3

View file

@ -52,7 +52,7 @@ func (a *audioStruct) playLoop() {
written, err := a.source.Write(d)
if err != nil {
if _, ok := err.(*os.PathError); !ok {
log.Error(err)
exit(err)
}
return
}
@ -74,7 +74,7 @@ func (a *audioStruct) recLoop() {
n, err := a.sink.Read(frameBuf)
if err != nil {
if _, ok := err.(*os.PathError); !ok {
log.Error(err)
exit(err)
}
return
}