From 7498648468133f6a490f020b8e36f1c696c71d5e Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Thu, 6 Feb 2014 15:06:59 +0100 Subject: [PATCH] android/client-audio: Fix not stopping play thread on write error --- android/client/if-audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/client/if-audio.c b/android/client/if-audio.c index 66f836421..db31c81ba 100644 --- a/android/client/if-audio.c +++ b/android/client/if-audio.c @@ -180,7 +180,7 @@ static void *playback_thread(void *data) int (*filbuff_cb) (short*, void*); short buffer[buffer_size / sizeof(short)]; size_t len = 0; - size_t w_len = 0; + ssize_t w_len = 0; FILE *in = data; void *cb_data = NULL; float freq = 440.0; @@ -223,7 +223,7 @@ static void *playback_thread(void *data) w_len = stream_out->write(stream_out, buffer, buffer_size); pthread_mutex_unlock(&outstream_mutex); - } while (len && w_len); + } while (len && w_len > 0); if (in) { fclose(in); -- 2.47.3