freebsd-ports/audio/cava/files/patch-input_sndio.c
Rainer Hurling b19d752832 audio/cava: Update to 0.7.3
Update from 0.7.1 to 0.7.3 brings several improvements and
bug fixes[1][2]. More important ones are:

- Fix install on macos
- ncurses mode is now default again
- Improved portaudio audio input
- Added Hann windowing and proper ring buffer

[1] https://github.com/karlstav/cava/releases/tag/0.7.3
[2] https://github.com/karlstav/cava/releases/tag/0.7.2

PR:		250862
Submitted by:	Adam Jimerson <vendion@gmail.com> (takes maintainership)
Approved by:	arrowd (mentor)
Differential Revision:	https://reviews.freebsd.org/D27091
2020-11-13 12:19:40 +00:00

22 lines
802 B
C

Stop using uninitialized variable after lazy refactoring upstream
--- input/sndio.c.orig 2020-10-29 12:44:33 UTC
+++ input/sndio.c
@@ -14,7 +14,7 @@ void *input_sndio(void *data) {
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) {
@@ -33,7 +33,7 @@ void *input_sndio(void *data) {
exit(EXIT_FAILURE);
}
- uint16_t frames = (sizeof(buf) / sizeof(buf[0])) / 2;
+ 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));