[145997] trunk/dports/audio/pulseaudio

ionic at macports.org ionic at macports.org
Tue Feb 23 19:07:26 PST 2016


Revision: 145997
          https://trac.macports.org/changeset/145997
Author:   ionic at macports.org
Date:     2016-02-23 19:07:26 -0800 (Tue, 23 Feb 2016)
Log Message:
-----------
pulseaudio: update to 8.0.

Changes:
  - Drop libsamplerate support, was already deprecated in 6.0 and speex
    can handle everything libsamplerate did.
  - Add soxr as a normal dependency for resampling support. Disable when
    using the minimal variant.
  - Refactor patches, drop upstreamed patches, rework the others.

Modified Paths:
--------------
    trunk/dports/audio/pulseaudio/Portfile
    trunk/dports/audio/pulseaudio/files/patch-configure.ac-coreservices.diff
    trunk/dports/audio/pulseaudio/files/patch-man-Makefile.am.diff
    trunk/dports/audio/pulseaudio/files/patch-src_daemon_caps.c-enable-root.diff
    trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-skip-consolekit-and-systemdlogin.diff
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_detect_device.c-add-record-playback-modarg.diff
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff

Added Paths:
-----------
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-dynamically-allocate-C-string-when-converting-from-CFString.patch
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-skip-unsupported-channels-count.diff

Removed Paths:
-------------
    trunk/dports/audio/pulseaudio/files/patch-configure.ac-add-HAVE_COREAUDIO.diff
    trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-load-module-coreaudio-detect.diff
    trunk/dports/audio/pulseaudio/files/patch-src_daemon_system.pa.in-load-module-coreaudio-detect.diff
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-channels.diff
    trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-device-names.diff

Modified: trunk/dports/audio/pulseaudio/Portfile
===================================================================
--- trunk/dports/audio/pulseaudio/Portfile	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/Portfile	2016-02-24 03:07:26 UTC (rev 145997)
@@ -8,8 +8,8 @@
 PortGroup           active_variants 1.1
 
 name                pulseaudio
-version             6.0
-revision            9
+version             8.0
+revision            0
 license             LGPL-2.1
 categories          audio
 maintainers         ionic openmaintainer
@@ -28,8 +28,8 @@
 
 use_xz              yes
 
-checksums           rmd160  a3f96cabc2872646c34ba581d6044dc4a6513fd9 \
-                    sha256  b50640e0b80b1607600accfad2e45aabb79d379bf6354c9671efa2065477f6f6
+checksums           rmd160  fc2700ec34ae9cbecd85c1ad6253b4c224541c96 \
+                    sha256  690eefe28633466cfd1ab9d85ebfa9376f6b622deec6bfee5091ac9737cd1989
 
 depends_build       port:pkgconfig \
                     port:intltool \
@@ -41,7 +41,6 @@
 depends_lib         port:libiconv \
                     port:json-c \
                     port:libsndfile \
-                    port:libsamplerate \
                     port:libtool \
                     port:gdbm \
                     path:lib/pkgconfig/glib-2.0.pc:glib2 \
@@ -49,7 +48,8 @@
                     port:dbus \
                     port:fftw-3-single \
                     path:lib/libspeex.dylib:speex \
-                    port:orc
+                    port:orc \
+                    port:soxr
 
 # configure falls back to libatomic_ops as last resort
 # if no linux kernel support and inline asm snippet fails to build
@@ -66,21 +66,18 @@
 #configure.cflags-append -g3 -ggdb3 -gdwarf-4 -O0
 #configure.cxxflags-append -g3 -ggdb3 -gdwarf-4 -O0
 
-# The last three patches make PulseAudio startup correctly.
+# Some patches make PulseAudio startup correctly.
 # Will hopefully be merged upstream soon.
-# All work has been sent upstream.
+# All work has or will be sent upstream.
 # C.f. https://bugs.freedesktop.org/show_bug.cgi?id=62987
 # and posts on the mailing list.
 patchfiles          patch-man-Makefile.am.diff \
                     i386.patch \
-                    patch-configure.ac-add-HAVE_COREAUDIO.diff \
                     patch-configure.ac-coreservices.diff \
-                    patch-src_daemon_default.pa.in-load-module-coreaudio-detect.diff \
-                    patch-src_daemon_system.pa.in-load-module-coreaudio-detect.diff \
+                    patch-src_modules_macosx_module_coreaudio_device.c-dynamically-allocate-C-string-when-converting-from-CFString.patch \
+                    patch-src_modules_macosx_module_coreaudio_device.c-skip-unsupported-channels-count.diff \
+                    patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff \
                     patch-src_daemon_default.pa.in-skip-consolekit-and-systemdlogin.diff \
-                    patch-src_modules_macosx_module_coreaudio_device.c-fix-device-names.diff \
-                    patch-src_modules_macosx_module_coreaudio_device.c-fix-channels.diff \
-                    patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff \
                     patch-src_modules_macosx_module_coreaudio_detect_device.c-add-record-playback-modarg.diff
 
 # reconfigure using upstream autogen.sh for intltool 0.51 compatibility
@@ -94,6 +91,7 @@
 
 configure.args      --with-mac-version-min=$macosx_deployment_target \
                     --with-caps \
+                    --with-soxr \
                     --disable-silent-rules \
                     --disable-tests \
                     --disable-x11 \
@@ -147,14 +145,17 @@
 
 variant minimal conflicts jack conflicts x11 description {Builds a minimal version. Do not use if unsure. Please build this ONLY in trace mode.} {
     depends_lib-delete      port:libiconv \
-                            port:libsamplerate \
                             port:gdbm \
                             path:lib/pkgconfig/glib-2.0.pc:glib2 \
                             port:gtk3 \
                             port:dbus \
                             port:fftw-3-single \
-                            port:orc
+                            port:orc \
+                            port:soxr
 
+    configure.args-replace  --with-soxr \
+                            --without-soxr
+
     configure.args-replace  --enable-orc \
                             --disable-orc
 

Deleted: trunk/dports/audio/pulseaudio/files/patch-configure.ac-add-HAVE_COREAUDIO.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-configure.ac-add-HAVE_COREAUDIO.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-configure.ac-add-HAVE_COREAUDIO.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,14 +0,0 @@
---- configure.ac.orig	2014-02-15 03:33:32.000000000 -0500
-+++ configure.ac	2014-11-23 22:05:59.000000000 -0500
-@@ -767,8 +794,11 @@
- AS_IF([test "x$enable_coreaudio_output" = "xyes" && test "x$HAVE_COREAUDIO" = "x0"],
-     [AC_MSG_ERROR([*** CoreAudio output support not found])])
- 
-+AC_SUBST(HAVE_COREAUDIO)
- AM_CONDITIONAL([HAVE_COREAUDIO], [test "x$HAVE_COREAUDIO" = "x1" && test "x$enable_coreaudio_output" != "xno"])
- 
-+AS_IF([test "x$HAVE_COREAUDIO" = "x1"], AC_DEFINE([HAVE_COREAUDIO], 1, [Have CoreAudio?]))
-+
- #### ALSA support (optional) ####
- 
- AC_ARG_ENABLE([alsa],

Modified: trunk/dports/audio/pulseaudio/files/patch-configure.ac-coreservices.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-configure.ac-coreservices.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-configure.ac-coreservices.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,6 +1,6 @@
---- configure.ac.orig	2015-06-16 02:16:21.000000000 -0700
-+++ configure.ac	2015-06-16 02:24:07.000000000 -0700
-@@ -521,13 +521,9 @@ AC_SEARCH_LIBS([backtrace], [execinfo ub
+--- configure.ac.old	2016-01-22 08:33:38.000000000 +0100
++++ configure.ac	2016-02-22 21:15:46.000000000 +0100
+@@ -533,13 +533,9 @@ AC_SEARCH_LIBS([backtrace], [execinfo ub
  # Darwin/OS X
  if test "x$os_is_darwin" = "x1" ; then
      AC_MSG_CHECKING([looking for Apple CoreService Framework])

Modified: trunk/dports/audio/pulseaudio/files/patch-man-Makefile.am.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-man-Makefile.am.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-man-Makefile.am.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,11 +1,11 @@
---- man/Makefile.am.old	2015-04-17 00:22:04.000000000 +0200
-+++ man/Makefile.am	2015-04-17 00:23:14.000000000 +0200
-@@ -59,7 +59,7 @@
+--- man/Makefile.am.old	2015-09-10 06:51:41.000000000 +0200
++++ man/Makefile.am	2016-02-22 20:59:16.000000000 +0100
+@@ -57,7 +57,7 @@ CLEANFILES = \
  	$(dist_man_MANS)
  
  %: %.xml Makefile
 -	$(AM_V_GEN) perl $(srcdir)/xmltoman $< > $@ || rm -f $@
 +	$(AM_V_GEN) @@MP_PERL@@ $(srcdir)/xmltoman $< > $@ || rm -f $@
  
- endif
- 
+ if OS_IS_WIN32
+ SYMLINK_PROGRAM=cd $(DESTDIR)$(man1dir) && cp

Modified: trunk/dports/audio/pulseaudio/files/patch-src_daemon_caps.c-enable-root.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_daemon_caps.c-enable-root.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_daemon_caps.c-enable-root.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,5 +1,5 @@
---- src/daemon/caps.c.old	2015-04-19 04:21:39.000000000 +0200
-+++ src/daemon/caps.c	2015-04-19 04:31:07.000000000 +0200
+--- src/daemon/caps.c.old	2015-09-10 06:51:41.000000000 +0200
++++ src/daemon/caps.c	2016-02-22 22:08:05.000000000 +0100
 @@ -54,22 +54,22 @@ void pa_drop_root(void) {
      gid = getgid();
  

Deleted: trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-load-module-coreaudio-detect.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-load-module-coreaudio-detect.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-load-module-coreaudio-detect.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,13 +0,0 @@
---- src/daemon/default.pa.in.orig	2014-01-23 13:57:55.000000000 -0500
-+++ src/daemon/default.pa.in	2014-11-23 22:03:02.000000000 -0500
-@@ -70,6 +70,10 @@
- .ifexists module-udev-detect at PA_SOEXT@
- load-module module-udev-detect
- .else
-+], @HAVE_COREAUDIO@, 1, [dnl
-+.ifexists module-coreaudio-detect at PA_SOEXT@
-+load-module module-coreaudio-detect record=1 playback=1
-+.else
- ], [dnl
- .ifexists module-detect at PA_SOEXT@
- ])dnl

Modified: trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-skip-consolekit-and-systemdlogin.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-skip-consolekit-and-systemdlogin.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_daemon_default.pa.in-skip-consolekit-and-systemdlogin.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,5 +1,5 @@
---- src/daemon/default.pa.in.old	2015-04-20 06:24:03.000000000 +0200
-+++ src/daemon/default.pa.in	2015-04-21 05:49:35.000000000 +0200
+--- src/daemon/default.pa.in.old	2016-01-18 11:14:20.000000000 +0100
++++ src/daemon/default.pa.in	2016-02-22 21:31:10.000000000 +0100
 @@ -153,12 +153,14 @@ load-module module-suspend-on-idle
  
  ### If autoexit on idle is enabled we want to make sure we only quit

Deleted: trunk/dports/audio/pulseaudio/files/patch-src_daemon_system.pa.in-load-module-coreaudio-detect.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_daemon_system.pa.in-load-module-coreaudio-detect.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_daemon_system.pa.in-load-module-coreaudio-detect.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,13 +0,0 @@
---- src/daemon/system.pa.in.orig	2014-01-23 13:57:55.000000000 -0500
-+++ src/daemon/system.pa.in	2014-11-23 22:04:15.000000000 -0500
-@@ -28,6 +28,10 @@
- .ifexists module-hal-detect at PA_SOEXT@
- load-module module-hal-detect
- .else
-+], @HAVE_COREAUDIO@, 1, [dnl
-+.ifexists module-coreaudio-detect at PA_SOEXT@
-+load-module module-coreaudio-detect
-+.else
- ], [dnl
- .ifexists module-detect at PA_SOEXT@
- ])dnl

Modified: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_detect_device.c-add-record-playback-modarg.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_detect_device.c-add-record-playback-modarg.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_detect_device.c-add-record-playback-modarg.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,5 +1,5 @@
---- src/modules/macosx/module-coreaudio-detect.c.old	2015-04-27 21:10:17.000000000 +0200
-+++ src/modules/macosx/module-coreaudio-detect.c	2015-04-27 22:09:07.000000000 +0200
+--- src/modules/macosx/module-coreaudio-detect.c.old	2015-09-10 06:51:41.000000000 +0200
++++ src/modules/macosx/module-coreaudio-detect.c	2016-02-23 00:59:31.000000000 +0100
 @@ -39,10 +39,14 @@ PA_MODULE_AUTHOR("Daniel Mack");
  PA_MODULE_DESCRIPTION("CoreAudio device detection");
  PA_MODULE_VERSION(PACKAGE_VERSION);
@@ -45,10 +45,17 @@
  
      m->userdata = u;
  
-@@ -220,6 +227,16 @@ int pa__init(pa_module *m) {
+@@ -220,6 +227,23 @@ int pa__init(pa_module *m) {
          goto fail;
      }
  
++    /*
++     * Set default value to true if not given as a modarg.
++     * In such a case, pa_modargs_get_value_boolean() will not touch the
++     * buffer.
++     */
++    u->playback = u->record = true;
++
 +    if (pa_modargs_get_value_boolean(ma, "record", &u->record) < 0 || pa_modargs_get_value_boolean(ma, "playback", &u->playback) < 0) {
 +        pa_log("record= and playback= expect boolean argument.");
 +        goto fail;
@@ -62,8 +69,8 @@
      pa_modargs_get_value_u32(ma, "ioproc_frames", &u->ioproc_frames);
  
      property_address.mSelector = kAudioHardwarePropertyDevices;
---- src/modules/macosx/module-coreaudio-device.c.old	2015-04-27 21:10:17.000000000 +0200
-+++ src/modules/macosx/module-coreaudio-device.c	2015-04-27 22:04:21.000000000 +0200
+--- src/modules/macosx/module-coreaudio-device.c.old	2016-02-23 00:57:43.000000000 +0100
++++ src/modules/macosx/module-coreaudio-device.c	2016-02-23 00:59:31.000000000 +0100
 @@ -58,11 +58,15 @@ PA_MODULE_DESCRIPTION("CoreAudio device"
  PA_MODULE_VERSION(PACKAGE_VERSION);
  PA_MODULE_LOAD_ONCE(false);

Added: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-dynamically-allocate-C-string-when-converting-from-CFString.patch
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-dynamically-allocate-C-string-when-converting-from-CFString.patch	                        (rev 0)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-dynamically-allocate-C-string-when-converting-from-CFString.patch	2016-02-24 03:07:26 UTC (rev 145997)
@@ -0,0 +1,121 @@
+--- src/modules/macosx/module-coreaudio-device.c.old	2016-01-18 11:14:20.000000000 +0100
++++ src/modules/macosx/module-coreaudio-device.c	2016-02-23 00:53:21.000000000 +0100
+@@ -376,23 +376,23 @@ static int ca_sink_set_state(pa_sink *s,
+ }
+ 
+ /* Caveat: The caller is responsible to get rid of the CFString(Ref). */
+-static bool CFString_to_cstr_n(CFStringRef cfstr, char *buf, long n) {
+-    bool ret;
+-
+-    pa_assert (buf);
+-
+-    ret = false;
++static char * CFString_to_cstr(CFStringRef cfstr) {
++    char *ret = NULL;
+ 
+     if (cfstr != NULL) {
+         const char *tmp = CFStringGetCStringPtr(cfstr, kCFStringEncodingUTF8);
++        CFIndex n = CFStringGetLength(cfstr) + 1 /* for the terminating NULL */;
++
++        ret = pa_xmalloc(n);
+ 
+         if (tmp == NULL) {
+-            if (CFStringGetCString(cfstr, buf, n, kCFStringEncodingUTF8))
+-                ret = true;
++            if (!CFStringGetCString(cfstr, ret, n, kCFStringEncodingUTF8)) {
++                pa_xfree(ret);
++                ret = NULL;
++            }
+         } else {
+-            strncpy(buf, tmp, n);
+-            buf[n - 1] = 0;
+-            ret = true;
++            strncpy(ret, tmp, n - 1);
++            ret[n - 1] = '\0';
+         }
+     }
+ 
+@@ -408,7 +408,7 @@ static int ca_device_create_sink(pa_modu
+     coreaudio_sink *ca_sink;
+     pa_sink *sink;
+     unsigned int i;
+-    char tmp[255];
++    char *tmp;
+     pa_strbuf *strbuf;
+     AudioObjectPropertyAddress property_address;
+     CFStringRef tmp_cfstr = NULL;
+@@ -425,23 +425,24 @@ static int ca_device_create_sink(pa_modu
+         property_address.mSelector = kAudioObjectPropertyElementName;
+         property_address.mScope = kAudioDevicePropertyScopeOutput;
+         property_address.mElement = channel_idx + i + 1;
+-        size = sizeof(tmp);
++        size = sizeof(tmp_cfstr);
+         err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, &tmp_cfstr);
+         if (err == 0) {
+-            err = !(CFString_to_cstr_n(tmp_cfstr, tmp, sizeof(tmp)));
++            tmp = CFString_to_cstr(tmp_cfstr);
+ 
+-            if (tmp_cfstr) {
++            if (tmp_cfstr)
+                 CFRelease(tmp_cfstr);
+-            }
+         }
+ 
+-        if (err || !strlen(tmp))
+-            snprintf(tmp, sizeof(tmp), "Channel %d", (int) property_address.mElement);
+-
+         if (i > 0)
+             pa_strbuf_puts(strbuf, ", ");
+ 
+-        pa_strbuf_puts(strbuf, tmp);
++        if (err || !tmp || !strlen(tmp))
++            pa_strbuf_printf(strbuf, "Channel %d", (int) property_address.mElement);
++        else
++            pa_strbuf_puts(strbuf, tmp);
++
++        pa_xfree(tmp);
+     }
+ 
+     ca_sink->name = pa_strbuf_to_string_free(strbuf);
+@@ -535,7 +536,7 @@ static int ca_device_create_source(pa_mo
+     coreaudio_source *ca_source;
+     pa_source *source;
+     unsigned int i;
+-    char tmp[255];
++    char *tmp;
+     pa_strbuf *strbuf;
+     AudioObjectPropertyAddress property_address;
+     CFStringRef tmp_cfstr = NULL;
+@@ -552,23 +553,24 @@ static int ca_device_create_source(pa_mo
+         property_address.mSelector = kAudioObjectPropertyElementName;
+         property_address.mScope = kAudioDevicePropertyScopeInput;
+         property_address.mElement = channel_idx + i + 1;
+-        size = sizeof(tmp);
++        size = sizeof(tmp_cfstr);
+         err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, &tmp_cfstr);
+         if (err == 0) {
+-            err = !(CFString_to_cstr_n(tmp_cfstr, tmp, sizeof(tmp)));
++            tmp = CFString_to_cstr(tmp_cfstr);
+ 
+-            if (tmp_cfstr) {
++            if (tmp_cfstr)
+                 CFRelease(tmp_cfstr);
+-            }
+         }
+ 
+-        if (err || !strlen(tmp))
+-            snprintf(tmp, sizeof(tmp), "Channel %d", (int) property_address.mElement);
+-
+         if (i > 0)
+             pa_strbuf_puts(strbuf, ", ");
+ 
+-        pa_strbuf_puts(strbuf, tmp);
++        if (err || !tmp || !strlen(tmp))
++            pa_strbuf_printf(strbuf, "Channel %d", (int) property_address.mElement);
++        else
++            pa_strbuf_puts(strbuf, tmp);
++
++        pa_xfree(tmp);
+     }
+ 
+     ca_source->name = pa_strbuf_to_string_free(strbuf);

Deleted: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-channels.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-channels.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-channels.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,86 +0,0 @@
---- src/modules/macosx/module-coreaudio-device.c.old	2015-04-19 07:45:52.000000000 +0200
-+++ src/modules/macosx/module-coreaudio-device.c	2015-04-19 07:59:17.000000000 +0200
-@@ -415,21 +415,28 @@ static int ca_device_create_sink(pa_modu
-     pa_sink_flags_t flags = PA_SINK_LATENCY | PA_SINK_HARDWARE;
-     coreaudio_sink *ca_sink;
-     pa_sink *sink;
--    unsigned int i;
-+    unsigned int i, channels;
-     char tmp[255];
-     pa_strbuf *strbuf;
-     AudioObjectPropertyAddress property_address;
-     CFStringRef tmp_cfstr;
- 
-     ca_sink = pa_xnew0(coreaudio_sink, 1);
--    ca_sink->map.channels = buf->mNumberChannels;
--    ca_sink->ss.channels = buf->mNumberChannels;
-+
-+    /* Clamp to PA_CHANNELS_MAX. */
-+    channels = buf->mNumberChannels;
-+    if (channels > PA_CHANNELS_MAX) {
-+        channels = PA_CHANNELS_MAX;
-+    }
-+
-+    ca_sink->map.channels = channels;
-+    ca_sink->ss.channels = channels;
-     ca_sink->channel_idx = channel_idx;
- 
-     /* build a name for this stream */
-     strbuf = pa_strbuf_new();
- 
--    for (i = 0; i < buf->mNumberChannels; i++) {
-+    for (i = 0; i < channels; i++) {
-         property_address.mSelector = kAudioObjectPropertyElementName;
-         property_address.mScope = kAudioDevicePropertyScopeOutput;
-         property_address.mElement = channel_idx + i + 1;
-@@ -456,7 +463,7 @@ static int ca_device_create_sink(pa_modu
-     for (i = 0; i < ca_sink->map.channels; i++)
-         ca_sink->map.map[i] = PA_CHANNEL_POSITION_MONO;
- 
--    if (buf->mNumberChannels == 2) {
-+    if (channels == 2) {
-         ca_sink->map.map[0] = PA_CHANNEL_POSITION_LEFT;
-         ca_sink->map.map[1] = PA_CHANNEL_POSITION_RIGHT;
-     }
-@@ -538,21 +545,28 @@ static int ca_device_create_source(pa_mo
-     pa_source_flags_t flags = PA_SOURCE_LATENCY | PA_SOURCE_HARDWARE;
-     coreaudio_source *ca_source;
-     pa_source *source;
--    unsigned int i;
-+    unsigned int i, channels;
-     char tmp[255];
-     pa_strbuf *strbuf;
-     AudioObjectPropertyAddress property_address;
-     CFStringRef tmp_cfstr;
- 
-     ca_source = pa_xnew0(coreaudio_source, 1);
--    ca_source->map.channels = buf->mNumberChannels;
--    ca_source->ss.channels = buf->mNumberChannels;
-+
-+    /* Clamp to PA_CHANNELS_MAX. */
-+    channels = buf->mNumberChannels;
-+    if (channels > PA_CHANNELS_MAX) {
-+        channels = PA_CHANNELS_MAX;
-+    }
-+
-+    ca_source->map.channels = channels;
-+    ca_source->ss.channels = channels;
-     ca_source->channel_idx = channel_idx;
- 
-     /* build a name for this stream */
-     strbuf = pa_strbuf_new();
- 
--    for (i = 0; i < buf->mNumberChannels; i++) {
-+    for (i = 0; i < channels; i++) {
-         property_address.mSelector = kAudioObjectPropertyElementName;
-         property_address.mScope = kAudioDevicePropertyScopeInput;
-         property_address.mElement = channel_idx + i + 1;
-@@ -579,7 +593,7 @@ static int ca_device_create_source(pa_mo
-     for (i = 0; i < ca_source->map.channels; i++)
-         ca_source->map.map[i] = PA_CHANNEL_POSITION_MONO;
- 
--    if (buf->mNumberChannels == 2) {
-+    if (channels == 2) {
-         ca_source->map.map[0] = PA_CHANNEL_POSITION_LEFT;
-         ca_source->map.map[1] = PA_CHANNEL_POSITION_RIGHT;
-     }

Deleted: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-device-names.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-device-names.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-fix-device-names.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,84 +0,0 @@
---- src/modules/macosx/module-coreaudio-device.c.old	2015-04-19 07:39:23.000000000 +0200
-+++ src/modules/macosx/module-coreaudio-device.c	2015-04-19 07:40:13.000000000 +0200
-@@ -374,6 +374,39 @@ static int ca_sink_set_state(pa_sink *s,
-     return 0;
- }
- 
-+/* Caveat: this function frees the CFString if conversion succeeded. */
-+static int CFString_to_cstr_n(CFStringRef cfstr, char *buf, long n) {
-+    int ret;
-+
-+    assert (buf);
-+
-+    ret = 0;
-+
-+    if (cfstr != NULL) {
-+        const char *tmp = CFStringGetCStringPtr(cfstr, kCFStringEncodingUTF8);
-+
-+        if (tmp == NULL) {
-+            if (CFStringGetCString(cfstr, buf, n, kCFStringEncodingUTF8))
-+                ret = 1;
-+        }
-+        else {
-+            strncpy(buf, tmp, n);
-+            buf[n - 1] = 0;
-+            ret = 1;
-+        }
-+    }
-+
-+    /*
-+     * A true value for ret implies cfstr != NULL, but let's still do the check
-+     * for safety reasons (i.e., should this code ever be re-organized...)
-+     */
-+    if (ret && cfstr != NULL) {
-+        CFRelease(cfstr);
-+    }
-+
-+    return ret;
-+}
-+
- static int ca_device_create_sink(pa_module *m, AudioBuffer *buf, int channel_idx) {
-     OSStatus err;
-     UInt32 size;
-@@ -386,6 +419,7 @@ static int ca_device_create_sink(pa_modu
-     char tmp[255];
-     pa_strbuf *strbuf;
-     AudioObjectPropertyAddress property_address;
-+    CFStringRef tmp_cfstr;
- 
-     ca_sink = pa_xnew0(coreaudio_sink, 1);
-     ca_sink->map.channels = buf->mNumberChannels;
-@@ -400,7 +434,11 @@ static int ca_device_create_sink(pa_modu
-         property_address.mScope = kAudioDevicePropertyScopeOutput;
-         property_address.mElement = channel_idx + i + 1;
-         size = sizeof(tmp);
--        err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, tmp);
-+        err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, &tmp_cfstr);
-+        if (err == 0) {
-+            err = !(CFString_to_cstr_n(tmp_cfstr, tmp, sizeof(tmp)));
-+        }
-+
-         if (err || !strlen(tmp))
-             snprintf(tmp, sizeof(tmp), "Channel %d", (int) property_address.mElement);
- 
-@@ -504,6 +542,7 @@ static int ca_device_create_source(pa_mo
-     char tmp[255];
-     pa_strbuf *strbuf;
-     AudioObjectPropertyAddress property_address;
-+    CFStringRef tmp_cfstr;
- 
-     ca_source = pa_xnew0(coreaudio_source, 1);
-     ca_source->map.channels = buf->mNumberChannels;
-@@ -518,7 +557,11 @@ static int ca_device_create_source(pa_mo
-         property_address.mScope = kAudioDevicePropertyScopeInput;
-         property_address.mElement = channel_idx + i + 1;
-         size = sizeof(tmp);
--        err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, tmp);
-+        err = AudioObjectGetPropertyData(u->object_id, &property_address, 0, NULL, &size, &tmp_cfstr);
-+        if (err == 0) {
-+            err = !(CFString_to_cstr_n(tmp_cfstr, tmp, sizeof(tmp)));
-+        }
-+
-         if (err || !strlen(tmp))
-             snprintf(tmp, sizeof(tmp), "Channel %d", (int) property_address.mElement);
- 

Modified: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff	2016-02-24 02:03:51 UTC (rev 145996)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-respect-PA_NAME_MAX.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -1,5 +1,5 @@
---- src/modules/macosx/module-coreaudio-device.c.old	2015-04-20 01:41:14.000000000 +0200
-+++ src/modules/macosx/module-coreaudio-device.c	2015-04-20 01:43:58.000000000 +0200
+--- src/modules/macosx/module-coreaudio-device.c.old	2016-02-23 23:32:59.000000000 +0100
++++ src/modules/macosx/module-coreaudio-device.c	2016-02-23 23:33:34.000000000 +0100
 @@ -43,6 +43,7 @@
  #include <pulsecore/thread.h>
  #include <pulsecore/thread-mq.h>
@@ -8,23 +8,24 @@
  
  #include <CoreAudio/CoreAudio.h>
  #include <CoreAudio/CoreAudioTypes.h>
-@@ -416,7 +417,7 @@ static int ca_device_create_sink(pa_modu
+@@ -408,7 +409,7 @@ static int ca_device_create_sink(pa_modu
      coreaudio_sink *ca_sink;
      pa_sink *sink;
-     unsigned int i, channels;
--    char tmp[255];
-+    char tmp[255], *tmp_clamp;
+     unsigned int i;
+-    char *tmp;
++    char *tmp, *tmp_clamp;
      pa_strbuf *strbuf;
      AudioObjectPropertyAddress property_address;
-     CFStringRef tmp_cfstr;
-@@ -455,7 +456,14 @@ static int ca_device_create_sink(pa_modu
-         pa_strbuf_puts(strbuf, tmp);
+     CFStringRef tmp_cfstr = NULL;
+@@ -450,7 +451,15 @@ static int ca_device_create_sink(pa_modu
+         pa_xfree(tmp);
      }
  
--    ca_sink->name = pa_strbuf_tostring_free(strbuf);
+-    ca_sink->name = pa_strbuf_to_string_free(strbuf);
 +    /* Clamp to PA_NAME_MAX and leave a "safety margin" for deduplication
 +     * and other appended data. */
-+    tmp_clamp = pa_strbuf_tostring_free(strbuf);
++    tmp_clamp = pa_strbuf_to_string_free(strbuf);
++    tmp = pa_xmalloc0(PA_NAME_MAX);
 +    strncpy(tmp, tmp_clamp, PA_NAME_MAX - 20);
 +    tmp[PA_NAME_MAX - 20] = 0;
 +    pa_xfree(tmp_clamp);
@@ -33,23 +34,24 @@
  
      pa_log_debug("Stream name is >%s<", ca_sink->name);
  
-@@ -546,7 +554,7 @@ static int ca_device_create_source(pa_mo
+@@ -541,7 +550,7 @@ static int ca_device_create_source(pa_mo
      coreaudio_source *ca_source;
      pa_source *source;
-     unsigned int i, channels;
--    char tmp[255];
-+    char tmp[255], *tmp_clamp;
+     unsigned int i;
+-    char *tmp;
++    char *tmp, *tmp_clamp;
      pa_strbuf *strbuf;
      AudioObjectPropertyAddress property_address;
-     CFStringRef tmp_cfstr;
-@@ -585,7 +593,14 @@ static int ca_device_create_source(pa_mo
-         pa_strbuf_puts(strbuf, tmp);
+     CFStringRef tmp_cfstr = NULL;
+@@ -583,7 +592,15 @@ static int ca_device_create_source(pa_mo
+         pa_xfree(tmp);
      }
  
--    ca_source->name = pa_strbuf_tostring_free(strbuf);
+-    ca_source->name = pa_strbuf_to_string_free(strbuf);
 +    /* Clamp to PA_NAME_MAX and leave a "safety margin" for deduplication
 +     * and other appended data. */
-+    tmp_clamp = pa_strbuf_tostring_free(strbuf);
++    tmp_clamp = pa_strbuf_to_string_free(strbuf);
++    tmp = pa_xmalloc0(PA_NAME_MAX);
 +    strncpy(tmp, tmp_clamp, PA_NAME_MAX - 20);
 +    tmp[PA_NAME_MAX - 20] = 0;
 +    pa_xfree(tmp_clamp);

Added: trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-skip-unsupported-channels-count.diff
===================================================================
--- trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-skip-unsupported-channels-count.diff	                        (rev 0)
+++ trunk/dports/audio/pulseaudio/files/patch-src_modules_macosx_module_coreaudio_device.c-skip-unsupported-channels-count.diff	2016-02-24 03:07:26 UTC (rev 145997)
@@ -0,0 +1,26 @@
+--- src/modules/macosx/module-coreaudio-device.c.old	2016-02-23 00:55:13.000000000 +0100
++++ src/modules/macosx/module-coreaudio-device.c	2016-02-23 00:55:49.000000000 +0100
+@@ -413,6 +413,11 @@ static int ca_device_create_sink(pa_modu
+     AudioObjectPropertyAddress property_address;
+     CFStringRef tmp_cfstr = NULL;
+ 
++    if (buf->mNumberChannels > PA_CHANNELS_MAX) {
++        pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
++        return -1;
++    }
++
+     ca_sink = pa_xnew0(coreaudio_sink, 1);
+     ca_sink->map.channels = buf->mNumberChannels;
+     ca_sink->ss.channels = buf->mNumberChannels;
+@@ -541,6 +546,11 @@ static int ca_device_create_source(pa_mo
+     AudioObjectPropertyAddress property_address;
+     CFStringRef tmp_cfstr = NULL;
+ 
++    if (buf->mNumberChannels > PA_CHANNELS_MAX) {
++        pa_log("Skipping device with more channels than we support (%u)", (unsigned int) buf->mNumberChannels);
++        return -1;
++    }
++
+     ca_source = pa_xnew0(coreaudio_source, 1);
+     ca_source->map.channels = buf->mNumberChannels;
+     ca_source->ss.channels = buf->mNumberChannels;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160223/f2ca7700/attachment-0001.html>


More information about the macports-changes mailing list