Recently Written · git

sad

sad (2f30.org simple audio daemon) with a Cygwin/OSS port on branch cygwin

git clone https://github.com/equwal/sad

Log | Files | Refs


commit 626a9880e45d4d5e7380162f63ec4f7eaf30a0b1
sin <sin@2f30.org>
2014-12-30 17:48:10 +0000

Bomb out if we cannot initialize the resampler

 mp3.c    | 3 ++-
 vorbis.c | 3 ++-
 wav.c    | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/mp3.c b/mp3.c
index d2c20b8..f99189e 100644
--- a/mp3.c
+++ b/mp3.c
@@ -44,7 +44,8 @@ mp3open(const char *name)
 		goto err0;
 	}
 
-	initresamplers(rate);
+	if (initresamplers(rate) < 0)
+		goto err0;
 
 	return 0;
 err0:
diff --git a/vorbis.c b/vorbis.c
index 7e46220..8aa36f2 100644
--- a/vorbis.c
+++ b/vorbis.c
@@ -34,7 +34,8 @@ vorbisopen(const char *name)
 		goto err0;
 	}
 
-	initresamplers(vi->rate);
+	if (initresamplers(vi->rate) < 0)
+		goto err0;
 
 	return 0;
 
diff --git a/wav.c b/wav.c
index 3669cbb..6985a9d 100644
--- a/wav.c
+++ b/wav.c
@@ -51,7 +51,8 @@ wavopen(const char *name)
 		goto err0;
 	}
 
-	initresamplers(sfinfo.samplerate);
+	if (initresamplers(sfinfo.samplerate) < 0)
+		goto err0;
 
 	return 0;
 err0: