From owner-svn-ports-head@freebsd.org Tue Aug 9 15:11:28 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30783BB49BD; Tue, 9 Aug 2016 15:11:28 +0000 (UTC) (envelope-from naddy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7E2187B; Tue, 9 Aug 2016 15:11:27 +0000 (UTC) (envelope-from naddy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u79FBRFp067728; Tue, 9 Aug 2016 15:11:27 GMT (envelope-from naddy@FreeBSD.org) Received: (from naddy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u79FBRro067725; Tue, 9 Aug 2016 15:11:27 GMT (envelope-from naddy@FreeBSD.org) Message-Id: <201608091511.u79FBRro067725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: naddy set sender to naddy@FreeBSD.org using -f From: Christian Weisgerber Date: Tue, 9 Aug 2016 15:11:27 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r419927 - in head/audio/libao: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2016 15:11:28 -0000 Author: naddy Date: Tue Aug 9 15:11:26 2016 New Revision: 419927 URL: https://svnweb.freebsd.org/changeset/ports/419927 Log: Enable sndio support in libao, based on the OpenBSD port. Also add --disable-alsa to CONFIGURE_ARGS because without it the port tries to link with libasound when it's installed. PR: 211662 Submitted by: Tobias Kortkamp Added: head/audio/libao/files/patch-src_plugins_sndio_ao__sndio.c (contents, props changed) Modified: head/audio/libao/Makefile head/audio/libao/pkg-plist Modified: head/audio/libao/Makefile ============================================================================== --- head/audio/libao/Makefile Tue Aug 9 15:00:03 2016 (r419926) +++ head/audio/libao/Makefile Tue Aug 9 15:11:26 2016 (r419927) @@ -16,13 +16,14 @@ USES= libtool pathfix pkgconfig USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-static \ + --disable-alsa \ --disable-arts INSTALL_TARGET= install-strip # do not install MAKE_ARGS= ckport_DATA="" -OPTIONS_DEFINE= DOCS ESOUND NAS PULSEAUDIO +OPTIONS_DEFINE= DOCS ESOUND NAS PULSEAUDIO SNDIO OPTIONS_SUB= yes NAS_LIB_DEPENDS=libaudio.so:audio/nas @@ -34,6 +35,9 @@ PULSEAUDIO_CONFIGURE_ENABLE= pulse ESOUND_CONFIGURE_ENABLE=esd ESOUND_USE= GNOME=esound +SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio +SNDIO_USES= localbase + post-patch: @${REINPLACE_CMD} -e 's|/etc/libao.conf|${PREFIX}&|' \ ${WRKSRC}/libao.conf.5 ${WRKSRC}/include/ao/ao_private.h \ Added: head/audio/libao/files/patch-src_plugins_sndio_ao__sndio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/audio/libao/files/patch-src_plugins_sndio_ao__sndio.c Tue Aug 9 15:11:26 2016 (r419927) @@ -0,0 +1,58 @@ +$OpenBSD: patch-src_plugins_sndio_ao_sndio_c,v 1.3 2014/05/27 19:44:56 naddy Exp $ +--- src/plugins/sndio/ao_sndio.c.orig 2012-02-14 00:46:06 UTC ++++ src/plugins/sndio/ao_sndio.c +@@ -99,6 +99,7 @@ int ao_plugin_set_option(ao_device *devi + int ao_plugin_open(ao_device *device, ao_sample_format *format) + { + ao_sndio_internal *internal = (ao_sndio_internal *) device->internal; ++ struct sio_hdl *hdl; + struct sio_par par; + + if(!internal->dev && internal->id>=0){ +@@ -107,20 +108,26 @@ int ao_plugin_open(ao_device *device, ao + internal->dev = strdup(buf); + } + +- internal->hdl = sio_open(internal->dev, SIO_PLAY, 0); +- if (internal->hdl == NULL) ++ hdl = sio_open(internal->dev, SIO_PLAY, 0); ++ if (hdl == NULL) + return 0; ++ internal->hdl = hdl; + + sio_initpar(&par); + par.sig = 1; +- par.le = SIO_LE_NATIVE; ++ if (format->bits > 8) ++ par.le = device->client_byte_format == AO_FMT_LITTLE ? 1 : 0; + par.bits = format->bits; + par.rate = format->rate; + par.pchan = device->output_channels; +- if (!sio_setpar(internal->hdl, &par)) ++ if (!sio_setpar(hdl, &par)) + return 0; +- device->driver_byte_format = AO_FMT_NATIVE; +- if (!sio_start(internal->hdl)) ++ if (!sio_getpar(hdl, &par)) ++ return 0; ++ if (par.bits != format->bits) ++ return 0; ++ device->driver_byte_format = par.le ? AO_FMT_LITTLE : AO_FMT_BIG; ++ if (!sio_start(hdl)) + return 0; + + if(!device->inter_matrix){ +@@ -148,9 +155,10 @@ int ao_plugin_close(ao_device *device) + ao_sndio_internal *internal = (ao_sndio_internal *) device->internal; + struct sio_hdl *hdl = internal->hdl; + +- if(hdl) +- if (!sio_stop(hdl)) +- return 0; ++ if(hdl){ ++ sio_close(hdl); ++ internal->hdl = NULL; ++ } + return 1; + } + Modified: head/audio/libao/pkg-plist ============================================================================== --- head/audio/libao/pkg-plist Tue Aug 9 15:00:03 2016 (r419926) +++ head/audio/libao/pkg-plist Tue Aug 9 15:11:26 2016 (r419927) @@ -9,6 +9,7 @@ lib/ao/plugins-4/liboss.so %%ESOUND%%lib/ao/plugins-4/libesd.so %%NAS%%lib/ao/plugins-4/libnas.so %%PULSEAUDIO%%lib/ao/plugins-4/libpulse.so +%%SNDIO%%lib/ao/plugins-4/libsndio.so libdata/pkgconfig/ao.pc man/man5/libao.conf.5.gz share/aclocal/ao.m4