Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio/au_sun.c: use AUDIO_INITINFO macro instead of AUDIO_GETINFO ioctl request. #107

Closed
adr-adr opened this issue Jan 30, 2024 · 0 comments

Comments

@adr-adr
Copy link

adr-adr commented Jan 30, 2024

Hi, I'm updating the pkgsrc port of flite. This small patch uses the macro AUDIO_INITINFO instead
of the AUDIO_GETINFO request and fixes audio_flush_sun(), it was using wrongly AUDIO_DRAIN.

--- src/audio/au_sun.c.orig	2020-08-13 00:17:09.000000000 +0000
+++ src/audio/au_sun.c
@@ -45,6 +45,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <sys/ioctl.h>
 #include <sys/filio.h>
 #include <sys/audioio.h>
 #include "cst_string.h"
@@ -76,7 +77,7 @@ cst_audiodev *audio_open_sun(int sps, in
 	    cst_error();
 	}
     }
-    ioctl(fd,AUDIO_GETINFO,&ainfo);
+    AUDIO_INITINFO(&ainfo);
 
     switch (fmt)
     {
@@ -163,7 +164,7 @@ int audio_write_sun(cst_audiodev *ad, vo
 
 int audio_flush_sun(cst_audiodev *ad)
 {
-    return ioctl((int)ad->platform_data, AUDIO_DRAIN, 0);
+    return ioctl((int)ad->platform_data, AUDIO_FLUSH, 0);
 }
 
 /* FIXME... */

flite_patch.patch

@adr-adr adr-adr closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant