Commit d3409a65 authored by Max Kellermann's avatar Max Kellermann

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.
parent 883e31d5
...@@ -19,6 +19,7 @@ ver 0.15 - (200?/??/??) ...@@ -19,6 +19,7 @@ ver 0.15 - (200?/??/??)
- null: allow disabling synchronization - null: allow disabling synchronization
- mvp: fall back to stereo - mvp: fall back to stereo
- mvp: fall back to 16 bit audio samples - mvp: fall back to 16 bit audio samples
- mvp: check for reopen errors
* commands: * commands:
- "playlistinfo" supports a range now - "playlistinfo" supports a range now
- added "sticker database", command "sticker", which allows clients - added "sticker database", command "sticker", which allows clients
......
...@@ -272,8 +272,13 @@ mvp_output_play(void *data, const void *chunk, size_t size) ...@@ -272,8 +272,13 @@ mvp_output_play(void *data, const void *chunk, size_t size)
ssize_t ret; ssize_t ret;
/* reopen the device since it was closed by dropBufferedAudio */ /* reopen the device since it was closed by dropBufferedAudio */
if (md->fd < 0) if (md->fd < 0) {
mvp_output_open(md, &md->audio_format); bool success;
success = mvp_output_open(md, &md->audio_format);
if (!success)
return 0;
}
while (true) { while (true) {
ret = write(md->fd, chunk, size); ret = write(md->fd, chunk, size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment