diff options
author | Max Kellermann <max@duempel.org> | 2008-10-29 20:40:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-29 20:40:33 +0100 |
commit | 2f76db4c7842ffdb989d2081b0835a83a3219f35 (patch) | |
tree | 19c7099501b78a2901a185f23dbb271d8a703f42 /src/output/shout_plugin.c | |
parent | 58c5bee9f0bcb46da7d113b66a4e1e2d7add9837 (diff) | |
download | mpd-2f76db4c7842ffdb989d2081b0835a83a3219f35.tar.gz mpd-2f76db4c7842ffdb989d2081b0835a83a3219f35.tar.xz mpd-2f76db4c7842ffdb989d2081b0835a83a3219f35.zip |
output: close device on play error
When an output plugin fails to play a chunk, close it. This replaces
various manual close() calls in nearly all plugins.
Diffstat (limited to 'src/output/shout_plugin.c')
-rw-r--r-- | src/output/shout_plugin.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/output/shout_plugin.c b/src/output/shout_plugin.c index 7bd806d36..00ce02590 100644 --- a/src/output/shout_plugin.c +++ b/src/output/shout_plugin.c @@ -525,7 +525,6 @@ my_shout_play(void *data, const char *chunk, size_t size) if (!sd->opened) { status = open_shout_conn(sd); if (status < 0) { - my_shout_close_device(sd); return false; } else if (status > 0) { timer_sync(sd->timer); @@ -533,15 +532,11 @@ my_shout_play(void *data, const char *chunk, size_t size) } } - if (sd->encoder->encode_func(sd, chunk, size)) { - my_shout_close_device(sd); + if (sd->encoder->encode_func(sd, chunk, size)) return false; - } - if (write_page(sd) < 0) { - my_shout_close_device(sd); + if (write_page(sd) < 0) return false; - } return true; } |