diff options
author | Tobias Kortkamp <tobik@FreeBSD.org> | 2020-05-30 00:39:11 +0000 |
---|---|---|
committer | Tobias Kortkamp <tobik@FreeBSD.org> | 2020-05-30 00:39:11 +0000 |
commit | 0803b3611a1ff13a2dab916722403ef4d7523052 (patch) | |
tree | 00777558bc02fe30f96d5eca0b710ee1c8fe5cfd /audio/cava/files/patch-input_sndio.c | |
parent | graphics/sane-backends: Update to 1.0.30 (diff) |
audio/cava: Update to 0.7.0
Changes: https://github.com/karlstav/cava/releases/tag/0.7.0
Notes
Notes:
svn path=/head/; revision=537023
Diffstat (limited to 'audio/cava/files/patch-input_sndio.c')
-rw-r--r-- | audio/cava/files/patch-input_sndio.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/audio/cava/files/patch-input_sndio.c b/audio/cava/files/patch-input_sndio.c new file mode 100644 index 000000000000..2e0d49c01f4f --- /dev/null +++ b/audio/cava/files/patch-input_sndio.c @@ -0,0 +1,29 @@ +Stop using uninitialized variable after lazy refactoring upstream + +--- input/sndio.c.orig 2020-05-29 23:20:44 UTC ++++ input/sndio.c +@@ -8,14 +8,13 @@ void *input_sndio(void *data) { + struct sio_par par; + struct sio_hdl *hdl; + int16_t buf[256]; +- unsigned int channels; + + sio_initpar(&par); + par.sig = 1; + par.bits = 16; + par.le = 1; + par.rate = 44100; +- par.rchan = 2; ++ par.rchan = audio->channels; + par.appbufsz = sizeof(buf) / par.rchan; + + if ((hdl = sio_open(audio->source, SIO_REC, 0)) == NULL) { +@@ -34,7 +33,7 @@ void *input_sndio(void *data) { + exit(EXIT_FAILURE); + } + +- uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / channels; ++ uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / audio->channels; + while (audio->terminate != 1) { + if (sio_read(hdl, buf, sizeof(buf)) == 0) { + fprintf(stderr, __FILE__ ": sio_read() failed: %s\n", strerror(errno)); |