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 5cde486d361f7420ec28c56ebdbc37272a886c51
sin <sin@2f30.org>
2014-12-31 19:30:38 +0000

Simplify s16monotostereo()

 output.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/output.c b/output.c
index d098d18..bca53a8 100644
--- a/output.c
+++ b/output.c
@@ -152,13 +152,13 @@ closeoutputs(void)
 }
 
 static void
-s16monotostereo(short *l, short *r, short *out, size_t nsamples)
+s16monotostereo(short *in, short *out, size_t nsamples)
 {
 	size_t i;
 
 	for (i = 0; i < nsamples; ++i) {
-		out[i * 2] = l[i];
-		out[i * 2 + 1] = r[i];
+		out[i * 2] = in[i];
+		out[i * 2 + 1] = in[i];
 	}
 }
 
@@ -182,7 +182,7 @@ playoutput(Format *fmt, Outputdesc *desc, void *buf, size_t nbytes)
 		inbuf = malloc(nbytes * 2);
 		if (!inbuf)
 			err(1, "malloc");
-		s16monotostereo(buf, buf, inbuf, nbytes / 2);
+		s16monotostereo(buf, inbuf, nbytes / 2);
 		nbytes *= 2;
 	} else {
 		inbuf = malloc(nbytes);