From d7e0a9005b27a9d122825713c1d5be44879b8302 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 14 Jan 2017 09:38:45 +0100 Subject: [PATCH] (rsound.c) Update rsound --- audio/drivers/rsound.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/audio/drivers/rsound.c b/audio/drivers/rsound.c index b5415a5593..229536004b 100644 --- a/audio/drivers/rsound.c +++ b/audio/drivers/rsound.c @@ -55,7 +55,9 @@ static void err_cb(void *userdata) scond_signal(rsd->cond); } -static void *rs_init(const char *device, unsigned rate, unsigned latency, unsigned *new_rate) +static void *rs_init(const char *device, unsigned rate, unsigned latency, + unsigned block_frames, + unsigned *new_rate) { int channels, format; rsound_t *rd = NULL; @@ -64,10 +66,7 @@ static void *rs_init(const char *device, unsigned rate, unsigned latency, unsign return NULL; if (rsd_init(&rd) < 0) - { - free(rsd); - return NULL; - } + goto error; rsd->cond_lock = slock_new(); rsd->cond = scond_new(); @@ -91,12 +90,15 @@ static void *rs_init(const char *device, unsigned rate, unsigned latency, unsign if (rsd_start(rd) < 0) { free(rsd); - rsd_free(rd); - return NULL; + goto error; } rsd->rd = rd; return rsd; + +error: + rsd_free(rd); + return NULL; } static ssize_t rs_write(void *data, const void *buf, size_t size)