mirror of https://bitbucket.org/ausocean/av.git
alsa: return EOF from alsa.Read so that pauses can be detected and input stopped
This commit is contained in:
parent
23e4607cc5
commit
f9a6bcc9dc
|
@ -435,8 +435,8 @@ func (d *ALSA) Read(p []byte) (int, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch err {
|
switch err {
|
||||||
case nil, io.EOF:
|
case nil, io.EOF:
|
||||||
d.l.Log(logger.Debug, pkg+"EOF")
|
d.l.Log(logger.Debug, pkg+"EOF from Read, stopping")
|
||||||
return n, nil
|
return n, err
|
||||||
default:
|
default:
|
||||||
d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error())
|
d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error())
|
||||||
return n, nil
|
return n, nil
|
||||||
|
|
Loading…
Reference in New Issue