audio/xanalyser: fix a ioctl call (now for real)

- SNDCTL_DSP_GETBLKSIZE() is in FreeBSD a read only ioctl()
  Need to use SNDCTL_DSP_SETBLKSIZE() to really set the blocksize.

PR:           193373
Submitted by: hselasky
Reviewed by:  Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>
Approved by:  db (maintainer)
This commit is contained in:
Kurt Jaeger 2018-09-03 18:21:27 +00:00
parent 91611ca8ac
commit a6be36a319
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=478888

View File

@ -0,0 +1,12 @@
--- src/pcm-oss.cc 2014-09-06 09:44:07.000000000 +0200
+++ src/pcm-oss.cc 2014-09-06 09:45:02.000000000 +0200
@@ -100,7 +100,8 @@
}
int tmp_buffer_size = want_buffer_size;
- if (ioctl (fd, SNDCTL_DSP_GETBLKSIZE, &tmp_buffer_size) == -1) {
+ if (ioctl (fd, SNDCTL_DSP_SETBLKSIZE, &tmp_buffer_size) == -1 ||
+ ioctl (fd, SNDCTL_DSP_GETBLKSIZE, &tmp_buffer_size) == -1) {
cerr << "error " << strerror (errno) << '\n';
return;
}