summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-30 21:11:28 +0100
committerwm4 <wm4@nowhere>2013-10-30 22:19:15 +0100
commita17b5364ea41cddeaad74031846272d0efbb672e (patch)
tree497d880e7cc2aa3b5c56c118899e1c11bf2b9516 /audio
parent7ac88cb05bba794955cbd380253c90d9e5d0af89 (diff)
downloadmpv-a17b5364ea41cddeaad74031846272d0efbb672e.tar.bz2
mpv-a17b5364ea41cddeaad74031846272d0efbb672e.tar.xz
ao_alsa: return negative value on error in play()
No functional change, because the only user of ao_play() ignores return values below 1.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_alsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c
index 1d0d19230f..1ad7598075 100644
--- a/audio/out/ao_alsa.c
+++ b/audio/out/ao_alsa.c
@@ -652,7 +652,7 @@ static int play(struct ao *ao, void *data, int len, int flags)
if (!p->alsa) {
MP_ERR(ao, "Device configuration error.");
- return 0;
+ return -1;
}
if (num_frames == 0)
@@ -678,10 +678,10 @@ static int play(struct ao *ao, void *data, int len, int flags)
}
} while (res == 0);
- return res < 0 ? 0 : res * p->bytes_per_sample;
+ return res < 0 ? -1 : res * p->bytes_per_sample;
alsa_error:
- return 0;
+ return -1;
}
/* how many byes are free in the buffer */