summaryrefslogtreecommitdiff
path: root/audio/timidity/patches
diff options
context:
space:
mode:
authorwiz <wiz>2007-06-08 17:18:53 +0000
committerwiz <wiz>2007-06-08 17:18:53 +0000
commitb3cb4224ab7528b7f800c2aadab3acfb2e45ef6d (patch)
treef13ae535dfe1e64f43460206b32445e12cc8b245 /audio/timidity/patches
parent794bdc37cfcdc4ab9c352ac149ac8f4a404854a4 (diff)
downloadpkgsrc-b3cb4224ab7528b7f800c2aadab3acfb2e45ef6d.tar.gz
Support PM_REQ_GETQSIZ and PM_REQ_GETFRAGSIZ in sun_a.c to improve
playback. From Sergey Svishchev in PR 35772. Bump PKGREVISION.
Diffstat (limited to 'audio/timidity/patches')
-rw-r--r--audio/timidity/patches/patch-aa59
1 files changed, 48 insertions, 11 deletions
diff --git a/audio/timidity/patches/patch-aa b/audio/timidity/patches/patch-aa
index 62b47231fa2..93c170e5491 100644
--- a/audio/timidity/patches/patch-aa
+++ b/audio/timidity/patches/patch-aa
@@ -1,16 +1,53 @@
-$NetBSD: patch-aa,v 1.6 2004/04/14 14:41:34 adam Exp $
+$NetBSD: patch-aa,v 1.7 2007/06/08 17:18:53 wiz Exp $
---- timidity/sun_a.c.orig 2002-07-19 00:43:58.000000000 +0000
+--- timidity/sun_a.c.orig 2007-06-08 17:14:22.000000000 +0000
+++ timidity/sun_a.c
-@@ -70,7 +70,11 @@
- #define SUNAUDIO_AENC_SIGWORD AENC_SIGWORDB
- #endif
+@@ -300,6 +300,18 @@ int output_data(char *buff, int32 nbytes
-+#ifndef __NetBSD__
- #define AUDIO_DEV "/dev/audio"
-+#else
-+#define AUDIO_DEV "/dev/sound"
-+#endif
- #define AUDIO_CTLDEV "/dev/audioctl"
+ #if !defined(I_FLUSH) || !defined(FLUSHW)
++# if defined(AUDIO_FLUSH) /* NetBSD */
++static int sun_discard_playing(void)
++{
++ if(ioctl(dpm.fd, AUDIO_FLUSH, NULL) < 0)
++ {
++ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: (ioctl) %s",
++ dpm.name, strerror(errno));
++ return -1;
++ }
++ return 0;
++}
++# else
+ static void null_proc(){}
+ static int sun_discard_playing(void)
+ {
+@@ -312,6 +324,7 @@ static int sun_discard_playing(void)
+ signal(SIGALRM, orig_alarm_handler);
+ return open_output();
+ }
++# endif
+ #else
+ static int sun_discard_playing(void)
+ {
+@@ -332,6 +345,21 @@ static int acntl(int request, void *arg)
+ switch(request)
+ {
++#ifdef __NetBSD__
++ case PM_REQ_GETQSIZ:
++ if(ioctl(audioctl_fd, AUDIO_GETINFO, &auinfo) < 0)
++ return -1;
++ return auinfo.play.buffer_size;
++
++ case PM_REQ_GETFRAGSIZ:
++ if(ioctl(audioctl_fd, AUDIO_GETINFO, &auinfo) < 0)
++ return -1;
++ return auinfo.blocksize;
++
++ case PM_REQ_OUTPUT_FINISH:
++ return ioctl(audioctl_fd, AUDIO_DRAIN, NULL);
++#endif
++
+ case PM_REQ_GETFILLED:
+ if(ioctl(audioctl_fd, AUDIO_GETINFO, &auinfo) < 0)
+ return -1;