From 10b47d8ff7790e0a8c9d5ca0206cda10af01b7e2 Mon Sep 17 00:00:00 2001 From: Pacho Ramos Date: Tue, 14 Feb 2012 08:43:43 +0000 Subject: Fix compilation problems against bluez, bug #403341 (by Steev Klimaszewski and Marcel Unbehaun); fix needing to enable socket, bug #401065 (by Andreas Eckstein and Ivan ivanov). Drop old. Package-Manager: portage-2.1.10.46/cvs/Linux x86_64 --- net-wireless/bluez/ChangeLog | 11 +- net-wireless/bluez/Manifest | 16 +- net-wireless/bluez/bluez-4.98-r2.ebuild | 181 +++++++++++++++++++++ net-wireless/bluez/bluez-4.98.ebuild | 171 ------------------- .../bluez/files/bluez-4.98-fix-header.patch | 71 ++++++++ .../bluez/files/bluez-4.98-fix-socket.patch | 54 ++++++ 6 files changed, 330 insertions(+), 174 deletions(-) create mode 100644 net-wireless/bluez/bluez-4.98-r2.ebuild delete mode 100644 net-wireless/bluez/bluez-4.98.ebuild create mode 100644 net-wireless/bluez/files/bluez-4.98-fix-header.patch create mode 100644 net-wireless/bluez/files/bluez-4.98-fix-socket.patch (limited to 'net-wireless') diff --git a/net-wireless/bluez/ChangeLog b/net-wireless/bluez/ChangeLog index 501808f12f3d..3494fca6e437 100644 --- a/net-wireless/bluez/ChangeLog +++ b/net-wireless/bluez/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-wireless/bluez # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/ChangeLog,v 1.120 2012/02/12 04:03:05 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/ChangeLog,v 1.121 2012/02/14 08:43:43 pacho Exp $ + +*bluez-4.98-r2 (14 Feb 2012) + + 14 Feb 2012; Pacho Ramos +bluez-4.98-r2.ebuild, + +files/bluez-4.98-fix-header.patch, +files/bluez-4.98-fix-socket.patch, + -bluez-4.98.ebuild: + Fix compilation problems against bluez, bug #403341 (by Steev Klimaszewski and + Marcel Unbehaun); fix needing to enable socket, bug #401065 (by Andreas + Eckstein and Ivan ivanov). Drop old. 12 Feb 2012; Jeff Horelick bluez-4.98-r1.ebuild: x86 stable per bug 399745 diff --git a/net-wireless/bluez/Manifest b/net-wireless/bluez/Manifest index 8866f25f9f7a..075b0cc41f59 100644 --- a/net-wireless/bluez/Manifest +++ b/net-wireless/bluez/Manifest @@ -1,9 +1,14 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX bluetooth-conf.d 181 RMD160 287e1806e25a4f74b4a9f6fc401b78dac31d44ee SHA1 595f897553a6e99000b4a4757f8973b9f39ce11d SHA256 63a96c907996158f637abc3202235b81e7c8a998df487b3e83554062433dd2f8 AUX bluetooth-init.d 767 RMD160 7afb50646e359ed1ede5abdc4e5e01319dc9e3c4 SHA1 3685d4dbbf56802cb03a483dad23825968dc57f8 SHA256 38efb9dffaab70477f7525dd6657dffc725c61e29c05b0649e95c31f589b31ce AUX bluetooth-init.d-r1 454 RMD160 c4521bba34ef4fc8fa2a624f55c900531d110b83 SHA1 3a0eccc0b2cf4801e594760660143fe1e2d8a53a SHA256 04de6c5bd2d2c702b0e27d7b379a284643cf2f5a03f3c5e3eaf1ac728d47b886 AUX bluez-4.18-udev.rules 228 RMD160 ab9b4ce8907c62eb9d1f14406cc2ff3f5ec69a19 SHA1 14e652de6cfed28f215727800460e600129007c2 SHA256 7577c2ed295b67f960f17ac65a44889c6536c125b34e33860d6d9f128a59fa82 AUX bluez-4.18-udev.script 752 RMD160 d8f60749dbe497bef7362a4c3f56b2b83ca079cb SHA1 0c39b4b4f4c57fb334daa793f89c0ffac046b956 SHA256 cb41a4eeea5137fb27d82d74f34e5e7dd725ddf8442c39ea623afe0d3c041fcf AUX bluez-4.67-udev.script 663 RMD160 324c46add5a485c759fa1a8fcdc658da2e9f69b8 SHA1 8b54b09d3cb6c715204ff58ef2432bbd73032bfe SHA256 9b134049b1c46fc57a497733a8dec8e354bfdc4186152fe739ae18abde702f24 +AUX bluez-4.98-fix-header.patch 2480 RMD160 c0992a1d04c5a9e7d77a00e69b85b1a14d8fe699 SHA1 c032a243ac97ed9b58c0659aecaaf10c50e90bfe SHA256 3f82fb3ab1eae44024a4ed4fb4cf5ddadefead4355d75bde503ea3eb8cb64dd1 +AUX bluez-4.98-fix-socket.patch 1598 RMD160 0e9b89b220f9d45d101f49b211d97d4387e08a2c SHA1 da119cb28756b5a09b0bfb16c6325d7b820726db SHA256 b67453b652f556b422a29c4b0eaeedeb89fc67f73b6bd7283ad1417434117b95 AUX bluez-plugdev.patch 469 RMD160 a70cd0310240491cf14a5a6d7b60e760804e9816 SHA1 b273aac740e7c19aebc441c6c77e0ba8d32f3480 SHA256 ec3f06f24f530574edf5eef308afcf16bb7e0a88336a454a0b24698d2491f5f2 AUX conf.d-dund 96 RMD160 cf0a59a45f6f1bab134e4aab3545a94dfe094ae0 SHA1 c8d3196d8a917ee5240900af8478bb5adc6c7dea SHA256 fcbf3993c373a71e14557ed35854e839fd7ebf3526f753c83cee07194afca64b AUX conf.d-hidd 89 RMD160 31407e00bcb00eb0b9c1adeb7434a922bfb967e9 SHA1 dc6831fa817c8bd2378830e13bc96d3ff3fdffa2 SHA256 8fc50b8c644e0bc69eacef2a9555118b2f4758aafcb42e8ea3ca1293e8f3a211 @@ -17,6 +22,13 @@ DIST oui-20110801.txt.xz 520980 RMD160 2f7c863825fa8ae35d9beebe6bbd49fddd32f32e DIST oui-20120113.txt.xz 541268 RMD160 445c782408d427bce66eadd3e179c425e3eb4c76 SHA1 6bc294d6992242648189b234e04afc96fce4a7cf SHA256 f65d2096566d88f9c55ce4da9104696cecb262a7d07c2f2ff58332f1ab40ae84 EBUILD bluez-4.96.ebuild 4834 RMD160 0e74d5819e7ea6a19d79ad810c67ee4c3082be7c SHA1 886b3c35f5eef4a49e73baa40f9e0b64e499f334 SHA256 124b2b14a9851319e45da0f0e484587d50f5c4e8d81e3b4e943a4d6c83f89201 EBUILD bluez-4.98-r1.ebuild 4615 RMD160 1065c78eca59086dd7c7e3de7ad0284bc0cc92a6 SHA1 7d74c8ecc3a45d75585fe0bd7a54de8e28280d5d SHA256 bb14509a236eca194f3d80f225ae9743d53aa12239533e4ea50e93d062d5db5a -EBUILD bluez-4.98.ebuild 4502 RMD160 205fb388b983a9fb5f8175cf4b55557768d1481b SHA1 1c9277dade40d1fd54e7204ff5be960b543275de SHA256 bea7c0d5e051c6caf5f664a4b91c18a39f41a236833a611ece1a49436a44fbff -MISC ChangeLog 24073 RMD160 eb7b744e7eb211bc2a02a3f86489d1fc95fe392a SHA1 422ff0491879b44af7cd74704b04b84181b87d44 SHA256 0f37a81ea18eb41edaf0dd1cb9d32d2b8e25d0b77dfc8c1f63c0a28f4319c02c +EBUILD bluez-4.98-r2.ebuild 4820 RMD160 e3d4cbf3ede8965b18384d4dd6b690c89796f72d SHA1 304452354b3f1a5906f7ab247b6c005cea4bdfed SHA256 64b871eaf3c7dad362dbbfba4f08b794043dd1f92793d5797ef749706ef5f783 +MISC ChangeLog 24462 RMD160 64a180cd24355eea858b13c0596f6288084b1f4d SHA1 19001f1076000ee98c2cb159939048ec38790741 SHA256 b940419a4f36b7542b466534bd42d16c394205878bb2b984514e4b09a9466edf MISC metadata.xml 1002 RMD160 39cba3b507b69bcf58bb5561d8d6af1fd4a9aef4 SHA1 b7eaf92005d3a6f1a697f179f87a2b31e52cf50e SHA256 eefe2611dfa35dc04b39e2c7b36d9ebdfb3764bf945249bf994bd20606dfdeef +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.17 (GNU/Linux) + +iEYEARECAAYFAk86HsUACgkQCaWpQKGI+9RauACfTAqrceiVaL+lDkiTqAL2Lt9X +b9gAn08Tb2vT2JfOd+0VKDdju5ryCq0Z +=Ccsp +-----END PGP SIGNATURE----- diff --git a/net-wireless/bluez/bluez-4.98-r2.ebuild b/net-wireless/bluez/bluez-4.98-r2.ebuild new file mode 100644 index 000000000000..05503e565fdc --- /dev/null +++ b/net-wireless/bluez/bluez-4.98-r2.ebuild @@ -0,0 +1,181 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.98-r2.ebuild,v 1.1 2012/02/14 08:43:43 pacho Exp $ + +EAPI="4" +PYTHON_DEPEND="test-programs? 2" + +inherit multilib eutils systemd python + +DESCRIPTION="Bluetooth Tools and System Daemons for Linux" +HOMEPAGE="http://www.bluez.org/" + +# Because of oui.txt changing from time to time without noticement, we need to supply it +# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly. +# See bugs #345263 and #349473 for reference. +OUIDATE="20120113" +SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz + http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" +IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb readline" + +CDEPEND=" + >=dev-libs/glib-2.14:2 + sys-apps/dbus + >=sys-fs/udev-169 + alsa? ( + media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] + media-libs/libsndfile + ) + caps? ( >=sys-libs/libcap-ng-0.6.2 ) + cups? ( net-print/cups ) + gstreamer? ( + >=media-libs/gstreamer-0.10:0.10 + >=media-libs/gst-plugins-base-0.10:0.10 + ) + usb? ( dev-libs/libusb:1 ) + readline? ( sys-libs/readline ) +" +DEPEND="${CDEPEND} + >=dev-util/pkgconfig-0.20 + sys-devel/flex + test-programs? ( >=dev-libs/check-0.9.6 ) +" +RDEPEND="${CDEPEND} + !net-wireless/bluez-libs + !net-wireless/bluez-utils + consolekit? ( + || ( sys-auth/consolekit + >=sys-apps/systemd-37 ) + ) + test-programs? ( + dev-python/dbus-python + dev-python/pygobject:2 + ) +" + +DOCS=( AUTHORS ChangeLog README ) + +pkg_setup() { + if ! use consolekit; then + enewgroup plugdev + fi + + if use test-programs; then + python_pkg_setup + fi +} + +src_prepare() { + # Fix compilation problems against bluez, bug #403341 + epatch "${FILESDIR}/${PN}-4.98-fix-header.patch" + + # Fix needing to enable socket, bug #401065 + epatch "${FILESDIR}/${PN}-4.98-fix-socket.patch" + + if ! use consolekit; then + # No consolekit for at_console etc, so we grant plugdev the rights + epatch "${FILESDIR}/bluez-plugdev.patch" + fi + + if use cups; then + sed -i \ + -e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \ + Makefile.tools Makefile.in || die + fi +} + +src_configure() { + use readline || export ac_cv_header_readline_readline_h=no + + econf \ + --enable-hid2hci \ + --enable-audio \ + --enable-bccmd \ + --enable-datafiles \ + --enable-dfutool \ + --enable-input \ + --enable-network \ + --enable-serial \ + --enable-service \ + --enable-tools \ + --disable-hal \ + --localstatedir=/var \ + --with-systemdunitdir="$(systemd_get_unitdir)" \ + $(use_enable alsa) \ + $(use_enable caps capng) \ + $(use_enable cups) \ + $(use_enable debug) \ + $(use_enable gstreamer) \ + $(use_enable pcmcia) \ + $(use_enable test-programs test) \ + $(use_enable usb) \ + --enable-health \ + --enable-maemo6 \ + --enable-pnat \ + --enable-wiimote +} + +src_install() { + default + + if use test-programs ; then + cd "${S}/test" + dobin simple-agent simple-service monitor-bluetooth + newbin list-devices list-bluetooth-devices + rm test-textfile.{c,o} || die # bug #356529 + for b in apitest hsmicro hsplay test-* ; do + newbin "${b}" "bluez-${b}" + done + insinto /usr/share/doc/${PF}/test-services + doins service-* + + python_convert_shebangs -r 2 "${ED}" + cd "${S}" + fi + + insinto /etc/bluetooth + doins \ + input/input.conf \ + audio/audio.conf \ + network/network.conf \ + serial/serial.conf + + newinitd "${FILESDIR}/bluetooth-init.d-r1" bluetooth + newinitd "${FILESDIR}/rfcomm-init.d" rfcomm + newconfd "${FILESDIR}/rfcomm-conf.d" rfcomm + + # Install oui.txt as requested in bug #283791 and approved by upstream + insinto /var/lib/misc + newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt + + find "${D}" -name "*.la" -delete +} + +pkg_postinst() { + udevadm control --reload-rules && udevadm trigger --subsystem-match=bluetooth + + if ! has_version "net-dialup/ppp"; then + elog "To use dial up networking you must install net-dialup/ppp." + fi + + if use consolekit; then + elog "If you want to use rfcomm as a normal user, you need to add the user" + elog "to the uucp group." + else + elog "Since you have the consolekit use flag disabled, you will only be able to run" + elog "bluetooth clients as root. If you want to be able to run bluetooth clientes as " + elog "a regular user, you need to enable the consolekit use flag for this package or" + elog "to add the user to the plugdev group." + fi + + if [ "$(rc-config list default | grep bluetooth)" = "" ] ; then + elog "You will need to add bluetooth service to default runlevel" + elog "for getting your devices detected from startup without needing" + elog "to reconnect them. For that please run:" + elog "'rc-update add bluetooth default'" + fi +} diff --git a/net-wireless/bluez/bluez-4.98.ebuild b/net-wireless/bluez/bluez-4.98.ebuild deleted file mode 100644 index 5b51076b9183..000000000000 --- a/net-wireless/bluez/bluez-4.98.ebuild +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez/bluez-4.98.ebuild,v 1.3 2012/01/26 11:39:09 chainsaw Exp $ - -EAPI="4" -PYTHON_DEPEND="test-programs? 2" - -inherit multilib eutils systemd python - -DESCRIPTION="Bluetooth Tools and System Daemons for Linux" -HOMEPAGE="http://www.bluez.org/" - -# Because of oui.txt changing from time to time without noticement, we need to supply it -# ourselves instead of using http://standards.ieee.org/regauth/oui/oui.txt directly. -# See bugs #345263 and #349473 for reference. -OUIDATE="20120113" -SRC_URI="mirror://kernel/linux/bluetooth/${P}.tar.xz - http://dev.gentoo.org/~pacho/bluez/oui-${OUIDATE}.txt.xz" - -LICENSE="GPL-2 LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" -IUSE="alsa caps +consolekit cups debug gstreamer pcmcia test-programs usb" - -CDEPEND=" - >=dev-libs/glib-2.14:2 - sys-apps/dbus - >=sys-fs/udev-146[extras] - alsa? ( - media-libs/alsa-lib[alsa_pcm_plugins_extplug(+),alsa_pcm_plugins_ioplug(+)] - media-libs/libsndfile - ) - caps? ( >=sys-libs/libcap-ng-0.6.2 ) - cups? ( net-print/cups ) - gstreamer? ( - >=media-libs/gstreamer-0.10:0.10 - >=media-libs/gst-plugins-base-0.10:0.10 - ) - usb? ( dev-libs/libusb:1 ) -" -DEPEND="${CDEPEND} - >=dev-util/pkgconfig-0.20 - sys-devel/flex - test-programs? ( >=dev-libs/check-0.9.6 ) -" -RDEPEND="${CDEPEND} - !net-wireless/bluez-libs - !net-wireless/bluez-utils - consolekit? ( - || ( sys-auth/consolekit - >=sys-apps/systemd-37 ) - ) - test-programs? ( - dev-python/dbus-python - dev-python/pygobject:2 - ) -" - -DOCS=( AUTHORS ChangeLog README ) - -pkg_setup() { - if ! use consolekit; then - enewgroup plugdev - fi - - if use test-programs; then - python_pkg_setup - fi -} - -src_prepare() { - if ! use consolekit; then - # No consolekit for at_console etc, so we grant plugdev the rights - epatch "${FILESDIR}/bluez-plugdev.patch" - fi - - if use cups; then - sed -i \ - -e "s:cupsdir = \$(libdir)/cups:cupsdir = `cups-config --serverbin`:" \ - Makefile.tools Makefile.in || die - fi -} - -src_configure() { - econf \ - --enable-audio \ - --enable-bccmd \ - --enable-datafiles \ - --enable-dfutool \ - --enable-input \ - --enable-network \ - --enable-serial \ - --enable-service \ - --enable-tools \ - --disable-hal \ - --localstatedir=/var \ - --with-systemdunitdir="$(systemd_get_unitdir)" \ - $(use_enable alsa) \ - $(use_enable caps capng) \ - $(use_enable cups) \ - $(use_enable debug) \ - $(use_enable gstreamer) \ - $(use_enable pcmcia) \ - $(use_enable test-programs test) \ - $(use_enable usb) \ - --enable-health \ - --enable-maemo6 \ - --enable-pnat \ - --enable-wiimote -} - -src_install() { - default - - if use test-programs ; then - cd "${S}/test" - dobin simple-agent simple-service monitor-bluetooth - newbin list-devices list-bluetooth-devices - rm test-textfile.{c,o} || die # bug #356529 - for b in apitest hsmicro hsplay test-* ; do - newbin "${b}" "bluez-${b}" - done - insinto /usr/share/doc/${PF}/test-services - doins service-* - - python_convert_shebangs -r 2 "${ED}" - cd "${S}" - fi - - insinto /etc/bluetooth - doins \ - input/input.conf \ - audio/audio.conf \ - network/network.conf \ - serial/serial.conf - - newinitd "${FILESDIR}/bluetooth-init.d-r1" bluetooth - newinitd "${FILESDIR}/rfcomm-init.d" rfcomm - newconfd "${FILESDIR}/rfcomm-conf.d" rfcomm - - # Install oui.txt as requested in bug #283791 and approved by upstream - insinto /var/lib/misc - newins "${WORKDIR}/oui-${OUIDATE}.txt" oui.txt - - find "${D}" -name "*.la" -delete -} - -pkg_postinst() { - udevadm control --reload-rules && udevadm trigger --subsystem-match=bluetooth - - if ! has_version "net-dialup/ppp"; then - elog "To use dial up networking you must install net-dialup/ppp." - fi - - if use consolekit; then - elog "If you want to use rfcomm as a normal user, you need to add the user" - elog "to the uucp group." - else - elog "Since you have the consolekit use flag disabled, you will only be able to run" - elog "bluetooth clients as root. If you want to be able to run bluetooth clientes as " - elog "a regular user, you need to enable the consolekit use flag for this package or" - elog "to add the user to the plugdev group." - fi - - if [ "$(rc-config list default | grep bluetooth)" = "" ] ; then - elog "You will need to add bluetooth service to default runlevel" - elog "for getting your devices detected from startup without needing" - elog "to reconnect them. For that please run:" - elog "'rc-update add bluetooth default'" - fi -} diff --git a/net-wireless/bluez/files/bluez-4.98-fix-header.patch b/net-wireless/bluez/files/bluez-4.98-fix-header.patch new file mode 100644 index 000000000000..5ca087df9ae1 --- /dev/null +++ b/net-wireless/bluez/files/bluez-4.98-fix-header.patch @@ -0,0 +1,71 @@ +The compiler error is: + /usr/include/bluetooth/bluetooth.h::131:9: error: invalid conversion from 'void*' to 'bt_get_le64(void*)::*' + ... + +The reason is that C++, in contrast to C, does not allow conversion of +void * to anything, and this code gets compiled as C++ when the app is +written in C++. The macro with the assignment itself is older, but only +recent Bluez starts to use it in inline functions, thus triggering the +problem. + +This patch keeps the "struct __attribute__((packed))" magic and merely +changes the typecast so that it works in C and C++. Like the existing +macro this patch relies on support for typeof. + +The new variant of the code is in an ifdef and only used for C++ +to avoid unexpected regressions in C applications. + +Signed-off-by: Patrick Ohly +--- + lib/bluetooth.h | 30 ++++++++++++++++++++++++++++++ + 1 files changed, 30 insertions(+), 0 deletions(-) + +Index: bluez-4.98/lib/bluetooth.h +=================================================================== +--- bluez-4.98.orig/lib/bluetooth.h 2012-02-05 13:20:23.753659182 +0100 ++++ bluez-4.98/lib/bluetooth.h 2012-02-05 13:26:33.905473976 +0100 +@@ -109,6 +109,12 @@ + #endif + + /* Bluetooth unaligned access */ ++#ifndef __cplusplus ++/* ++ * traditional code, doesn't work in C++ because ++ * of the void * to struct pointer assignment ++ */ ++ + #define bt_get_unaligned(ptr) \ + ({ \ + struct __attribute__((packed)) { \ +@@ -125,6 +131,31 @@ + __p->__v = (val); \ + } while(0) + ++#else /* __cplusplus */ ++ ++/* ++ * modified code with typeof typecast, for C++; ++ * the traditional code continues to be used for ++ * C to avoid unexpected regressions with this ++ * code here (it should work in C and C++, though) ++ */ ++#define bt_get_unaligned(ptr) \ ++({ \ ++ struct __attribute__((packed)) { \ ++ typeof(*(ptr)) __v; \ ++ } *__p = (typeof(__p)) (ptr); \ ++ __p->__v; \ ++}) ++ ++#define bt_put_unaligned(val, ptr) \ ++do { \ ++ struct __attribute__((packed)) { \ ++ typeof(*(ptr)) __v; \ ++ } *__p = (typeof(__p)) (ptr); \ ++ __p->__v = (val); \ ++} while(0) ++#endif /* __cplusplus */ ++ + #if __BYTE_ORDER == __LITTLE_ENDIAN + static inline uint64_t bt_get_le64(void *ptr) + { \ No newline at end of file diff --git a/net-wireless/bluez/files/bluez-4.98-fix-socket.patch b/net-wireless/bluez/files/bluez-4.98-fix-socket.patch new file mode 100644 index 000000000000..6f16c5fdf96e --- /dev/null +++ b/net-wireless/bluez/files/bluez-4.98-fix-socket.patch @@ -0,0 +1,54 @@ +diff --git a/audio/a2dp.c b/audio/a2dp.c +index c4cdc62..2eebe6b 100644 +--- a/audio/a2dp.c ++++ b/audio/a2dp.c +@@ -1441,9 +1441,9 @@ static struct a2dp_server *find_server(GSList *list, const bdaddr_t *src) + + int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + { +- int sbc_srcs = 1, sbc_sinks = 1; ++ int sbc_srcs = 0, sbc_sinks = 0; + int mpeg12_srcs = 0, mpeg12_sinks = 0; +- gboolean source = TRUE, sink = FALSE, socket = TRUE; ++ gboolean source = TRUE, sink = FALSE, socket = FALSE; + gboolean delay_reporting = FALSE; + char *str; + GError *err = NULL; +@@ -1463,6 +1463,8 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + source = TRUE; + if (strstr(str, "Source")) + sink = TRUE; ++ if (strstr(str, "Socket")) ++ socket = TRUE; + g_free(str); + } + +@@ -1482,18 +1484,14 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + } + + /* Don't register any local sep if Socket is disabled */ +- if (socket == FALSE) { +- sbc_srcs = 0; +- sbc_sinks = 0; +- mpeg12_srcs = 0; +- mpeg12_sinks = 0; ++ if (socket == FALSE) + goto proceed; +- } + + str = g_key_file_get_string(config, "A2DP", "SBCSources", &err); + if (err) { + DBG("audio.conf: %s", err->message); + g_clear_error(&err); ++ sbc_srcs = 1; + } else { + sbc_srcs = atoi(str); + g_free(str); +@@ -1512,6 +1510,7 @@ int a2dp_register(DBusConnection *conn, const bdaddr_t *src, GKeyFile *config) + if (err) { + DBG("audio.conf: %s", err->message); + g_clear_error(&err); ++ sbc_sinks = 1; + } else { + sbc_sinks = atoi(str); + g_free(str); -- cgit v1.2.3-65-gdbad