mirror of https://bitbucket.org/ausocean/av.git
alsa: error handling
This commit is contained in:
parent
78279d4405
commit
563897eb8c
|
@ -377,7 +377,10 @@ func (d *ALSA) input() {
|
|||
d.dev.Close()
|
||||
d.dev = nil
|
||||
}
|
||||
d.buf.Close()
|
||||
err := d.buf.Close()
|
||||
if err != nil {
|
||||
d.l.Log(logger.Error, "unable to close pool buffer", "error", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -418,7 +421,7 @@ func (d *ALSA) Read(p []byte) (int, error) {
|
|||
_, err := d.buf.Next(rbNextTimeout)
|
||||
if err != nil {
|
||||
switch err {
|
||||
case nil, io.EOF:
|
||||
case io.EOF:
|
||||
d.l.Log(logger.Debug, pkg+"EOF from Next")
|
||||
return 0, err
|
||||
case pool.ErrTimeout:
|
||||
|
@ -435,7 +438,7 @@ func (d *ALSA) Read(p []byte) (int, error) {
|
|||
n, err := d.buf.Read(p)
|
||||
if err != nil {
|
||||
switch err {
|
||||
case nil, io.EOF:
|
||||
case io.EOF:
|
||||
d.l.Log(logger.Debug, pkg+"EOF from Read")
|
||||
return n, err
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue