diff options
author | nia <nia@pkgsrc.org> | 2021-09-09 21:41:59 +0000 |
---|---|---|
committer | nia <nia@pkgsrc.org> | 2021-09-09 21:41:59 +0000 |
commit | cbc29400c44283b1d877b2f81cc98f9a002db369 (patch) | |
tree | 884de1ab8ebd681418ebeb9edb4ae7c251e24ae3 /audio | |
parent | aba8fffb670298081c5cf8d0369cfbd11d05e2a7 (diff) | |
download | pkgsrc-cbc29400c44283b1d877b2f81cc98f9a002db369.tar.gz |
portaudio: Fix playing very short files in Audacity with Sun backend
According to portaudio's own docs, my previous code was correct -
aborting the stream should cause any queued samples to be dropped.
However, audacity seems to be abusing the portaudio API and calling
Abort immediately once it's finished processing the output...
Diffstat (limited to 'audio')
-rw-r--r-- | audio/portaudio/Makefile | 4 | ||||
-rw-r--r-- | audio/portaudio/distinfo | 4 | ||||
-rw-r--r-- | audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c | 25 |
3 files changed, 8 insertions, 25 deletions
diff --git a/audio/portaudio/Makefile b/audio/portaudio/Makefile index 976828396cc..7d5959965fc 100644 --- a/audio/portaudio/Makefile +++ b/audio/portaudio/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.33 2021/09/08 21:04:57 nia Exp $ +# $NetBSD: Makefile,v 1.34 2021/09/09 21:41:59 nia Exp $ DISTNAME= pa_stable_v190600_20161030 PKGNAME= ${DISTNAME:S/^pa_stable_v/portaudio-/1:S/_/./g} -PKGREVISION= 8 +PKGREVISION= 9 CATEGORIES= audio MASTER_SITES= http://www.portaudio.com/archives/ EXTRACT_SUFX= .tgz diff --git a/audio/portaudio/distinfo b/audio/portaudio/distinfo index 3f786913a73..098c9b9ec5d 100644 --- a/audio/portaudio/distinfo +++ b/audio/portaudio/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.25 2021/01/16 21:06:52 reinoud Exp $ +$NetBSD: distinfo,v 1.26 2021/09/09 21:41:59 nia Exp $ SHA1 (pa_stable_v190600_20161030.tgz) = 56c596bba820d90df7d057d8f6a0ec6bf9ab82e8 RMD160 (pa_stable_v190600_20161030.tgz) = e6e5cd3f3cb7469aa17549c189e445d573567e13 @@ -14,5 +14,5 @@ SHA1 (patch-src_common_pa__stream.c) = 58e6ab2a61957208973a59be2f1140abc922f360 SHA1 (patch-src_common_pa__stream.h) = 94781a9ae79ea1340eea8caadc106416c019cf74 SHA1 (patch-src_hostapi_alsa_pa__linux__alsa.c) = 71daf913422f72aa379ae8cc302186800cff7717 SHA1 (patch-src_hostapi_oss_pa__unix__oss.c) = 572c48f64104e22e7ae49acc54a26e549e381b5b -SHA1 (patch-src_hostapi_sun_pa__unix__sun.c) = 0a2d26e477bb4c45d56b8d70db5a939911f4cf64 +SHA1 (patch-src_hostapi_sun_pa__unix__sun.c) = bab9b21d35d76afafa06c929bb35954d3870bc0d SHA1 (patch-src_os_unix_pa__unix__hostapis.c) = 8cfc7d7aac8f9803e204711ded3d64842913f4fd diff --git a/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c b/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c index 0fb58037706..277a55c1a10 100644 --- a/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c +++ b/audio/portaudio/patches/patch-src_hostapi_sun_pa__unix__sun.c @@ -1,10 +1,10 @@ -$NetBSD: patch-src_hostapi_sun_pa__unix__sun.c,v 1.3 2021/01/16 21:06:52 reinoud Exp $ +$NetBSD: patch-src_hostapi_sun_pa__unix__sun.c,v 1.4 2021/09/09 21:42:00 nia Exp $ Sun/NetBSD audio support. ---- src/hostapi/sun/pa_unix_sun.c.orig 2021-01-16 19:57:35.080979704 +0000 +--- src/hostapi/sun/pa_unix_sun.c.orig 2021-09-09 21:10:47.132269006 +0000 +++ src/hostapi/sun/pa_unix_sun.c -@@ -0,0 +1,1140 @@ +@@ -0,0 +1,1123 @@ +/* + * $Id" + * PortAudio Portable Real-Time Audio Library @@ -100,11 +100,6 @@ Sun/NetBSD audio support. +#define SUN_DEV_DEFAULT "/dev/audio" +#endif + -+#ifndef AUDIO_FLUSH -+#include <sys/stropts.h> -+#define AUDIO_FLUSH I_FLUSH -+#endif -+ +#ifndef AUDIO_ENCODING_SLINEAR +#define AUDIO_ENCODING_SLINEAR AUDIO_ENCODING_LINEAR +#endif @@ -919,19 +914,7 @@ Sun/NetBSD audio support. + +static PaError AbortStream( PaStream *s ) +{ -+ PaError result = paNoError; -+ PaSunStream *stream = (PaSunStream*)s; -+ -+ stream->stopped = true; -+ -+ if( stream->bufferProcessor.streamCallback ) -+ PA_ENSURE( PaUtil_CancelThreading( &stream->threading, 0, NULL ) ); -+ -+ if( stream->play.fd != -1 ) -+ (void)ioctl(stream->play.fd, AUDIO_FLUSH); -+ -+error: -+ return result; ++ StopStream(s); +} + +static PaError IsStreamStopped( PaStream *s ) |