alsa: return EOF from alsa.Read so that pauses can be detected and input stopped

This commit is contained in:
Trek H 2022-02-09 16:38:10 +10:30
parent 23e4607cc5
commit f9a6bcc9dc
1 changed files with 2 additions and 2 deletions

View File

@ -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