[Midnightbsd-cvs] mports [21762] trunk/audio/alsa-plugins: alsa plugins 1.1.1

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Aug 20 12:02:34 EDT 2016


Revision: 21762
          http://svnweb.midnightbsd.org/mports/?rev=21762
Author:   laffer1
Date:     2016-08-20 12:01:30 -0400 (Sat, 20 Aug 2016)
Log Message:
-----------
alsa plugins 1.1.1

Modified Paths:
--------------
    trunk/audio/alsa-plugins/Makefile
    trunk/audio/alsa-plugins/distinfo
    trunk/audio/alsa-plugins/files/patch-configure

Added Paths:
-----------
    trunk/audio/alsa-plugins/files/patch-arcam-av_arcam__av.c
    trunk/audio/alsa-plugins/files/patch-oss_ctl__oss.c
    trunk/audio/alsa-plugins/files/patch-oss_pcm__oss.c
    trunk/audio/alsa-plugins/files/patch-usb__stream_pcm__usb__stream.c

Removed Paths:
-------------
    trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c
    trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c
    trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c
    trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c

Modified: trunk/audio/alsa-plugins/Makefile
===================================================================
--- trunk/audio/alsa-plugins/Makefile	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/Makefile	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,10 +1,10 @@
 # $MidnightBSD$
 
 PORTNAME=	alsa-plugins
-PORTVERSION=	1.0.29
+PORTVERSION=	1.1.1
 CATEGORIES=	audio
-MASTER_SITES=	ALSA/plugins \
-		GENTOO/distfiles
+MASTER_SITES=	ftp://ftp.alsa-project.org/pub/plugins/ \
+		GENTOO
 
 MAINTAINER=	ports at MidnightBSD.org
 COMMENT=	ALSA compatibility library plugins
@@ -14,13 +14,12 @@
 LIB_DEPENDS=	libasound.so:${PORTSDIR}/audio/alsa-lib
 
 GNU_CONFIGURE=	yes
-USES=		libtool:keepla pkgconfig tar:bzip2
+USES=		alias libtool:keepla localbase pkgconfig tar:bzip2
 EXTRA_PATCHES+=	${FILESDIR}/alsa-plugins.patch
 INSTALL_TARGET=	install-strip
 CPPFLAGS+=	-I${.CURDIR}/../alsa-lib/files
-LDFLAGS+=	-L${LOCALBASE}/lib
 
-OPTIONS_DEFAULT=IO_PTR
+OPTIONS_DEFAULT=BUFSZ_P2 IO_PTR
 OPTIONS_DEFINE=	JACK FFMPEG PULSEAUDIO SAMPLERATE SPEEX
 OPTIONS_SUB=	yes
 
@@ -39,10 +38,10 @@
 
 JACK_LIB_DEPENDS=	libjack.so:${PORTSDIR}/audio/jack
 JACK_CONFIGURE_ENABLE=	jack
+JACK_IMPLIES=		SAMPLERATE
 
 FFMPEG_LIB_DEPENDS=	libavcodec.so:${PORTSDIR}/multimedia/ffmpeg
 FFMPEG_CONFIGURE_ENABLE=avcodec
-FFMPEG_CPPFLAGS=	-I${LOCALBASE}/include
 
 PULSEAUDIO_LIB_DEPENDS=	libpulse.so:${PORTSDIR}/audio/pulseaudio
 PULSEAUDIO_CONFIGURE_ENABLE=pulseaudio

Modified: trunk/audio/alsa-plugins/distinfo
===================================================================
--- trunk/audio/alsa-plugins/distinfo	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/distinfo	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,2 +1,2 @@
-SHA256 (alsa-plugins-1.0.29.tar.bz2) = 325d85cac285f632b83e0191ae3f348bad03c1f007b937042f164abb81ea6532
-SIZE (alsa-plugins-1.0.29.tar.bz2) = 366077
+SHA256 (alsa-plugins-1.1.1.tar.bz2) = 8ea4d1e082c36528a896a2581e5eb62d4dc2683238e353050d0d624e65f901f1
+SIZE (alsa-plugins-1.1.1.tar.bz2) = 366193

Deleted: trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c
===================================================================
--- trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,19 +0,0 @@
---- arcam-av/arcam_av.c.orig
-+++ arcam-av/arcam_av.c
-@@ -27,6 +27,7 @@
- #include <signal.h>
- #include <stddef.h>
- #include <stdio.h>
-+#include <string.h>
- #include <termios.h>
- #include <unistd.h>
- 
-@@ -37,6 +38,8 @@
- #include <sys/socket.h>
- #include <sys/un.h>
- 
-+#define AF_FILE     AF_UNIX
-+
- #define MIN(a, b)     ((a) < (b) ? (a) : (b))
- #define MAX(a, b)     ((a) > (b) ? (a) : (b))
- 

Copied: trunk/audio/alsa-plugins/files/patch-arcam-av_arcam__av.c (from rev 21508, trunk/audio/alsa-plugins/files/patch-arcam-av-arcam_av.c)
===================================================================
--- trunk/audio/alsa-plugins/files/patch-arcam-av_arcam__av.c	                        (rev 0)
+++ trunk/audio/alsa-plugins/files/patch-arcam-av_arcam__av.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -0,0 +1,19 @@
+--- arcam-av/arcam_av.c.orig
++++ arcam-av/arcam_av.c
+@@ -27,6 +27,7 @@
+ #include <signal.h>
+ #include <stddef.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <termios.h>
+ #include <unistd.h>
+ 
+@@ -37,6 +38,8 @@
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ 
++#define AF_FILE     AF_UNIX
++
+ #define MIN(a, b)     ((a) < (b) ? (a) : (b))
+ #define MAX(a, b)     ((a) > (b) ? (a) : (b))
+ 

Modified: trunk/audio/alsa-plugins/files/patch-configure
===================================================================
--- trunk/audio/alsa-plugins/files/patch-configure	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/files/patch-configure	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,6 +1,6 @@
---- configure.orig	2010-04-16 13:18:56.000000000 +0200
-+++ configure	2010-05-11 00:08:29.000000000 +0200
-@@ -19608,14 +19608,6 @@ else
+--- configure.orig	2016-03-31 13:14:07 UTC
++++ configure
+@@ -12402,14 +12402,6 @@ else
  $as_echo "yes" >&6; }
  	HAVE_SPEEXDSP="yes"
  fi
@@ -15,7 +15,7 @@
  
  
  # Check whether --with-speex was given.
-@@ -19626,6 +19618,15 @@ else
+@@ -12420,6 +12412,15 @@ else
  fi
  
  

Deleted: trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c
===================================================================
--- trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,23 +0,0 @@
---- oss/ctl_oss.c.orig	2008-10-29 08:42:13.000000000 -0400
-+++ oss/ctl_oss.c
-@@ -26,7 +26,11 @@
- #include <sys/ioctl.h>
- #include <alsa/asoundlib.h>
- #include <alsa/control_external.h>
-+#ifdef __linux__
- #include <linux/soundcard.h>
-+#else
-+#include <sys/soundcard.h>
-+#endif
- 
- typedef struct snd_ctl_oss {
- 	snd_ctl_ext_t ext;
-@@ -52,7 +56,7 @@ static const char *const vol_devices[SOU
- 	[SOUND_MIXER_CD] =	"CD Playback Volume",
- 	[SOUND_MIXER_IMIX] =	"Monitor Mix Playback Volume",
- 	[SOUND_MIXER_ALTPCM] =	"Headphone Playback Volume",
--	[SOUND_MIXER_RECLEV] =	"Capture Volume",
-+	[SOUND_MIXER_RECLEV] =	"Master Capture Volume",
- 	[SOUND_MIXER_IGAIN] =	"Capture Volume",
- 	[SOUND_MIXER_OGAIN] =	"Playback Volume",
- 	[SOUND_MIXER_LINE1] =	"Aux Playback Volume",

Deleted: trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c
===================================================================
--- trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,29 +0,0 @@
---- oss/pcm_oss.c.orig	2008-10-29 08:42:13.000000000 -0400
-+++ oss/pcm_oss.c
-@@ -22,4 +22,8 @@
- #include <sys/ioctl.h>
- #include <alsa/asoundlib.h>
- #include <alsa/pcm_external.h>
-+#ifdef __linux__
- #include <linux/soundcard.h>
-+#else
-+#include <sys/soundcard.h>
-+#endif
-@@ -116,7 +120,7 @@ static int oss_drain(snd_pcm_ioplug_t *i
- 	snd_pcm_oss_t *oss = io->private_data;
- 
- 	if (io->stream == SND_PCM_STREAM_PLAYBACK)
--		ioctl(oss->fd, SNDCTL_DSP_SYNC);
-+		ioctl(oss->fd, SNDCTL_DSP_SYNC, NULL);
- 	return 0;
- }
- 
-@@ -125,7 +129,7 @@ static int oss_prepare(snd_pcm_ioplug_t 
- 	snd_pcm_oss_t *oss = io->private_data;
- 	int tmp;
- 
--	ioctl(oss->fd, SNDCTL_DSP_RESET);
-+	ioctl(oss->fd, SNDCTL_DSP_RESET, NULL);
- 
- 	tmp = io->channels;
- 	if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0) {

Copied: trunk/audio/alsa-plugins/files/patch-oss_ctl__oss.c (from rev 21508, trunk/audio/alsa-plugins/files/patch-oss-ctl_oss.c)
===================================================================
--- trunk/audio/alsa-plugins/files/patch-oss_ctl__oss.c	                        (rev 0)
+++ trunk/audio/alsa-plugins/files/patch-oss_ctl__oss.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -0,0 +1,23 @@
+--- oss/ctl_oss.c.orig	2008-10-29 08:42:13.000000000 -0400
++++ oss/ctl_oss.c
+@@ -26,7 +26,11 @@
+ #include <sys/ioctl.h>
+ #include <alsa/asoundlib.h>
+ #include <alsa/control_external.h>
++#ifdef __linux__
+ #include <linux/soundcard.h>
++#else
++#include <sys/soundcard.h>
++#endif
+ 
+ typedef struct snd_ctl_oss {
+ 	snd_ctl_ext_t ext;
+@@ -52,7 +56,7 @@ static const char *const vol_devices[SOU
+ 	[SOUND_MIXER_CD] =	"CD Playback Volume",
+ 	[SOUND_MIXER_IMIX] =	"Monitor Mix Playback Volume",
+ 	[SOUND_MIXER_ALTPCM] =	"Headphone Playback Volume",
+-	[SOUND_MIXER_RECLEV] =	"Capture Volume",
++	[SOUND_MIXER_RECLEV] =	"Master Capture Volume",
+ 	[SOUND_MIXER_IGAIN] =	"Capture Volume",
+ 	[SOUND_MIXER_OGAIN] =	"Playback Volume",
+ 	[SOUND_MIXER_LINE1] =	"Aux Playback Volume",

Copied: trunk/audio/alsa-plugins/files/patch-oss_pcm__oss.c (from rev 21508, trunk/audio/alsa-plugins/files/patch-oss-pcm_oss.c)
===================================================================
--- trunk/audio/alsa-plugins/files/patch-oss_pcm__oss.c	                        (rev 0)
+++ trunk/audio/alsa-plugins/files/patch-oss_pcm__oss.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -0,0 +1,29 @@
+--- oss/pcm_oss.c.orig	2008-10-29 08:42:13.000000000 -0400
++++ oss/pcm_oss.c
+@@ -22,4 +22,8 @@
+ #include <sys/ioctl.h>
+ #include <alsa/asoundlib.h>
+ #include <alsa/pcm_external.h>
++#ifdef __linux__
+ #include <linux/soundcard.h>
++#else
++#include <sys/soundcard.h>
++#endif
+@@ -116,7 +120,7 @@ static int oss_drain(snd_pcm_ioplug_t *i
+ 	snd_pcm_oss_t *oss = io->private_data;
+ 
+ 	if (io->stream == SND_PCM_STREAM_PLAYBACK)
+-		ioctl(oss->fd, SNDCTL_DSP_SYNC);
++		ioctl(oss->fd, SNDCTL_DSP_SYNC, NULL);
+ 	return 0;
+ }
+ 
+@@ -125,7 +129,7 @@ static int oss_prepare(snd_pcm_ioplug_t 
+ 	snd_pcm_oss_t *oss = io->private_data;
+ 	int tmp;
+ 
+-	ioctl(oss->fd, SNDCTL_DSP_RESET);
++	ioctl(oss->fd, SNDCTL_DSP_RESET, NULL);
+ 
+ 	tmp = io->channels;
+ 	if (ioctl(oss->fd, SNDCTL_DSP_CHANNELS, &tmp) < 0) {

Copied: trunk/audio/alsa-plugins/files/patch-usb__stream_pcm__usb__stream.c (from rev 21508, trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c)
===================================================================
--- trunk/audio/alsa-plugins/files/patch-usb__stream_pcm__usb__stream.c	                        (rev 0)
+++ trunk/audio/alsa-plugins/files/patch-usb__stream_pcm__usb__stream.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -0,0 +1,86 @@
+based on https://github.com/dankamongmen/libdank/blob/master/libdank/compat-FreeBSD.c
+
+--- usb_stream/pcm_usb_stream.c.orig
++++ usb_stream/pcm_usb_stream.c
+@@ -79,6 +81,69 @@ typedef struct {
+ static struct user_usb_stream *uus;
+ static pthread_mutex_t uus_mutex = PTHREAD_MUTEX_INITIALIZER;
+ 
++#ifndef __linux__
++/*
++ * Copyright (c) 2000-2011, Nick Black et al
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ *     * Redistributions of source code must retain the above copyright
++ *       notice, this list of conditions and the following disclaimer.
++ *     * Redistributions in binary form must reproduce the above copyright
++ *       notice, this list of conditions and the following disclaimer in the
++ *       documentation and/or other materials provided with the distribution.
++ *     * Neither the name of Nick Black nor the names of other contributors may
++ *	be used to endorse or promote products derived from this software
++ *	without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
++ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
++ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright
++ * holder> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
++ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++// This is suitable really only for use with libdank's mremap_and_ftruncate(),
++// due to assumptions it makes about the flags to pass to mmap(2). The only
++// mremap(2) use case addressed is that of MREMAP_MAYMOVE. oldaddr must be a
++// valid previous return from mmap(); NULL is not acceptable (ala Linux's
++// mremap(2)), resulting in undefined behavior, despite realloc(3) semantics.
++// Similarly, oldlen and newlen must be non-zero (and page-aligned).
++void *mremap_compat(int fd,void *oldaddr,size_t oldlen,
++				size_t newlen,int prot,int flags){
++	void *ret;
++
++	// From mmap(2) on freebsd 6.3: A successful FIXED mmap deletes any
++	// previous mapping in the allocated address range. This means:
++	// remapping over a current map will blow it away (unless FIXED isn't
++	// provided, in which case it can't overlap an old mapping. See bug
++	// 733 for extensive discussion of this issue for Linux and FreeBSD).
++	if((ret = mmap((char *)oldaddr + oldlen,newlen - oldlen,prot,flags,fd,oldlen)) == MAP_FAILED){
++		// We couldn't get the memory whatsoever (or we were a fresh
++		// allocation that succeeded). Return the immediate result...
++		return ret;
++	} // ret != MAP_FAILED. Did we squash?
++	if(ret != (char *)oldaddr + oldlen){
++		// We got the memory, but not where we wanted it. Copy over the
++		// old map, and then free it up...
++		munmap(ret,newlen - oldlen);
++		if((ret = mmap(NULL,newlen,prot,flags,fd,0)) == MAP_FAILED){
++			return ret;
++		}
++		memcpy(ret,oldaddr,oldlen);
++		munmap(oldaddr,oldlen); // Free the old mapping
++		return ret;
++	} // We successfully squashed. Return a pointer to the first buf.
++	return oldaddr;
++}
++#endif
++
+ static struct user_usb_stream *get_uus(const char *card)
+ {
+ 	pthread_mutex_lock(&uus_mutex);
+@@ -219,7 +284,11 @@ static int snd_pcm_us_prepare(snd_pcm_io
+ 		}
+ 
+ 
++#ifdef __linux__
+ 		uus->s = mremap(uus->s, sizeof(struct usb_stream), uus->s->read_size, MREMAP_MAYMOVE);
++#else
++		uus->s = mremap_compat(us->pfd.fd, uus->s, sizeof(struct usb_stream), uus->s->read_size, PROT_READ, MAP_SHARED);
++#endif
+ 		if (MAP_FAILED == uus->s) {
+ 			perror("ALSA/USX2Y: mmap");
+ 			return -EPERM;

Deleted: trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c
===================================================================
--- trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c	2016-08-20 15:57:03 UTC (rev 21761)
+++ trunk/audio/alsa-plugins/files/patch-usb_stream-pcm_usb_stream.c	2016-08-20 16:01:30 UTC (rev 21762)
@@ -1,86 +0,0 @@
-based on https://github.com/dankamongmen/libdank/blob/master/libdank/compat-FreeBSD.c
-
---- usb_stream/pcm_usb_stream.c.orig
-+++ usb_stream/pcm_usb_stream.c
-@@ -79,6 +81,69 @@ typedef struct {
- static struct user_usb_stream *uus;
- static pthread_mutex_t uus_mutex = PTHREAD_MUTEX_INITIALIZER;
- 
-+#ifndef __linux__
-+/*
-+ * Copyright (c) 2000-2011, Nick Black et al
-+ * All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions are met:
-+ *     * Redistributions of source code must retain the above copyright
-+ *       notice, this list of conditions and the following disclaimer.
-+ *     * Redistributions in binary form must reproduce the above copyright
-+ *       notice, this list of conditions and the following disclaimer in the
-+ *       documentation and/or other materials provided with the distribution.
-+ *     * Neither the name of Nick Black nor the names of other contributors may
-+ *	be used to endorse or promote products derived from this software
-+ *	without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <copyright
-+ * holder> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-+ * POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+// This is suitable really only for use with libdank's mremap_and_ftruncate(),
-+// due to assumptions it makes about the flags to pass to mmap(2). The only
-+// mremap(2) use case addressed is that of MREMAP_MAYMOVE. oldaddr must be a
-+// valid previous return from mmap(); NULL is not acceptable (ala Linux's
-+// mremap(2)), resulting in undefined behavior, despite realloc(3) semantics.
-+// Similarly, oldlen and newlen must be non-zero (and page-aligned).
-+void *mremap_compat(int fd,void *oldaddr,size_t oldlen,
-+				size_t newlen,int prot,int flags){
-+	void *ret;
-+
-+	// From mmap(2) on freebsd 6.3: A successful FIXED mmap deletes any
-+	// previous mapping in the allocated address range. This means:
-+	// remapping over a current map will blow it away (unless FIXED isn't
-+	// provided, in which case it can't overlap an old mapping. See bug
-+	// 733 for extensive discussion of this issue for Linux and FreeBSD).
-+	if((ret = mmap((char *)oldaddr + oldlen,newlen - oldlen,prot,flags,fd,oldlen)) == MAP_FAILED){
-+		// We couldn't get the memory whatsoever (or we were a fresh
-+		// allocation that succeeded). Return the immediate result...
-+		return ret;
-+	} // ret != MAP_FAILED. Did we squash?
-+	if(ret != (char *)oldaddr + oldlen){
-+		// We got the memory, but not where we wanted it. Copy over the
-+		// old map, and then free it up...
-+		munmap(ret,newlen - oldlen);
-+		if((ret = mmap(NULL,newlen,prot,flags,fd,0)) == MAP_FAILED){
-+			return ret;
-+		}
-+		memcpy(ret,oldaddr,oldlen);
-+		munmap(oldaddr,oldlen); // Free the old mapping
-+		return ret;
-+	} // We successfully squashed. Return a pointer to the first buf.
-+	return oldaddr;
-+}
-+#endif
-+
- static struct user_usb_stream *get_uus(const char *card)
- {
- 	pthread_mutex_lock(&uus_mutex);
-@@ -219,7 +284,11 @@ static int snd_pcm_us_prepare(snd_pcm_io
- 		}
- 
- 
-+#ifdef __linux__
- 		uus->s = mremap(uus->s, sizeof(struct usb_stream), uus->s->read_size, MREMAP_MAYMOVE);
-+#else
-+		uus->s = mremap_compat(us->pfd.fd, uus->s, sizeof(struct usb_stream), uus->s->read_size, PROT_READ, MAP_SHARED);
-+#endif
- 		if (MAP_FAILED == uus->s) {
- 			perror("ALSA/USX2Y: mmap");
- 			return -EPERM;



More information about the Midnightbsd-cvs mailing list