aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-25 21:57:02 +0100
committerMax Kellermann <max@duempel.org>2009-02-25 21:57:02 +0100
commitd3409a65b57b232ff4f703ae7acdd2e75545c54c (patch)
tree7492cb3cbe5ea6c9edacaddedfcd98777191f52d
parent883e31d55b9265589e544c0b75a2367fd01c4d8b (diff)
downloadmpd-d3409a65b57b232ff4f703ae7acdd2e75545c54c.tar.gz
mpd-d3409a65b57b232ff4f703ae7acdd2e75545c54c.tar.xz
mpd-d3409a65b57b232ff4f703ae7acdd2e75545c54c.zip
mvp: check for reopen errors
When the MVP device has been closed in the cancel() method, and the play() method attempts to reopen it, check for errors.
-rw-r--r--NEWS1
-rw-r--r--src/output/mvp_plugin.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 629b29826..324a8e4b8 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ ver 0.15 - (200?/??/??)
- null: allow disabling synchronization
- mvp: fall back to stereo
- mvp: fall back to 16 bit audio samples
+ - mvp: check for reopen errors
* commands:
- "playlistinfo" supports a range now
- added "sticker database", command "sticker", which allows clients
diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c
index 2bf79afad..65df5a2aa 100644
--- a/src/output/mvp_plugin.c
+++ b/src/output/mvp_plugin.c
@@ -272,8 +272,13 @@ mvp_output_play(void *data, const void *chunk, size_t size)
ssize_t ret;
/* reopen the device since it was closed by dropBufferedAudio */
- if (md->fd < 0)
- mvp_output_open(md, &md->audio_format);
+ if (md->fd < 0) {
+ bool success;
+
+ success = mvp_output_open(md, &md->audio_format);
+ if (!success)
+ return 0;
+ }
while (true) {
ret = write(md->fd, chunk, size);