From 9a049de85951a16415b4b6b08c67375fe5167561 Mon Sep 17 00:00:00 2001 From: Dimitris Papastamos Date: Thu, 23 Jun 2016 13:10:03 +0100 Subject: [PATCH] output/sndio: No need to use a loop in Play() This is a left-over from the previous version of the code that was retrying on EINTR. --- src/output/plugins/SndioOutputPlugin.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx index 69747ae2c..d5741ea1d 100644 --- a/src/output/plugins/SndioOutputPlugin.cxx +++ b/src/output/plugins/SndioOutputPlugin.cxx @@ -180,16 +180,10 @@ SndioOutput::Play(const void *chunk, size_t size, Error &error) { size_t n; - while (1) { - n = sio_write(sio_hdl, chunk, size); - if (n == 0) { - if (sio_eof(sio_hdl)) { - error.Set(sndio_output_domain, -1, "sndio write failed"); - return 0; - } - } - return n; - } + n = sio_write(sio_hdl, chunk, size); + if (n == 0 && sio_eof(sio_hdl) != 0) + error.Set(sndio_output_domain, -1, "sndio write failed"); + return n; } typedef AudioOutputWrapper Wrapper;