[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-7-gb03a650
Lennart Poettering
gitmailer-noreply at 0pointer.de
Sat Apr 18 17:07:49 PDT 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from 1c0667de21e183d8a3ac79bba2bc534a6f38b690 (commit)
- Log -----------------------------------------------------------------
b03a650 reserve-device: allow building without D-Bus
-----------------------------------------------------------------------
Summary of changes:
src/Makefile.am | 4 ++--
src/modules/reserve-wrap.c | 30 +++++++++++++++++++++++-------
2 files changed, 25 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
commit b03a650160def727ff6547cdc35351d76dceecfd
Author: Erich Boleyn <erich at uruk.org>
Date: Wed Apr 15 23:02:59 2009 -0700
reserve-device: allow building without D-Bus
Lennart Poettering <lennart at poettering.net> wrote:
> On Wed, 15.04.09 16:26, Erich Boleyn (erich at uruk.org) wrote:
>
> > Just noticed the new 0.9.15 release, got it building on Gentoo, and then
> > found that the non-dbus build's ALSA modules appear to be broken:
...
> > Is this something that can stubbed out (relatively) safely?
>
> Hmm, yes. As it seems I broke the build for non-dbus builds. Should be
> easy to fix. Best way is probably to make the reserver wrapper mostly
> a noop if D-Bus is not available.
>
> Please understand that I don't really focus on making every weird
> combination of build deps work. So I won't fix this for you. But I am
> happy to merge good patches!
No problem, I was mainly looking for a hint that to your knowledge there
should be no wierd side-effects from stubbing out the reserve and dbus
functions inside reserve_wrapper. Thanks for said hint. ;-)
Attached is a patch to include "reserve_wrapper.[ch]" in the non-dbus
builds, and do said stubbing when HAVE_DBUS is not defined. It has
passed moderate testing: built both versions, both pass
"pulseaudio --dump-modules" with no weird messages, and the
"--disable-dbus" build works and produces audio as expected in some
simple tests including RTP.
diff --git a/src/Makefile.am b/src/Makefile.am
index 0d4f53a..716d865 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1315,7 +1315,7 @@ module_oss_la_LIBADD = $(AM_LIBADD) liboss-util.la libpulsecore- at PA_MAJORMINORMI
# ALSA
-libalsa_util_la_SOURCES = modules/alsa/alsa-util.c modules/alsa/alsa-util.h modules/alsa/alsa-sink.c modules/alsa/alsa-sink.h modules/alsa/alsa-source.c modules/alsa/alsa-source.h
+libalsa_util_la_SOURCES = modules/alsa/alsa-util.c modules/alsa/alsa-util.h modules/alsa/alsa-sink.c modules/alsa/alsa-sink.h modules/alsa/alsa-source.c modules/alsa/alsa-source.h modules/reserve-wrap.c modules/reserve-wrap.h
libalsa_util_la_LDFLAGS = -avoid-version
libalsa_util_la_LIBADD = $(AM_LIBADD) $(ASOUNDLIB_LIBS) libpulsecore- at PA_MAJORMINORMICRO@.la libpulsecommon- at PA_MAJORMINORMICRO@.la libpulse.la
libalsa_util_la_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
@@ -1333,7 +1333,7 @@ libalsa_util_la_CFLAGS += $(UDEV_CFLAGS)
endif
if HAVE_DBUS
-libalsa_util_la_SOURCES += modules/reserve.h modules/reserve.c modules/reserve-wrap.c modules/reserve-wrap.h
+libalsa_util_la_SOURCES += modules/reserve.h modules/reserve.c
libalsa_util_la_LIBADD += $(DBUS_LIBS)
libalsa_util_la_CFLAGS += $(DBUS_CFLAGS)
endif
diff --git a/src/modules/reserve-wrap.c b/src/modules/reserve-wrap.c
index 02ff29b..d0d014d 100644
--- a/src/modules/reserve-wrap.c
+++ b/src/modules/reserve-wrap.c
@@ -31,30 +31,37 @@
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
#include <pulsecore/shared.h>
-#include <pulsecore/dbus-shared.h>
+#ifdef HAVE_DBUS
+#include <pulsecore/dbus-shared.h>
#include "reserve.h"
+#endif
+
#include "reserve-wrap.h"
struct pa_reserve_wrapper {
PA_REFCNT_DECLARE;
pa_core *core;
- pa_dbus_connection *connection;
pa_hook hook;
- struct rd_device *device;
char *shared_name;
+#ifdef HAVE_DBUS
+ pa_dbus_connection *connection;
+ struct rd_device *device;
+#endif
};
static void reserve_wrapper_free(pa_reserve_wrapper *r) {
pa_assert(r);
+#ifdef HAVE_DBUS
if (r->device)
rd_release(r->device);
- pa_hook_done(&r->hook);
-
if (r->connection)
pa_dbus_connection_unref(r->connection);
+#endif
+
+ pa_hook_done(&r->hook);
if (r->shared_name) {
pa_assert_se(pa_shared_remove(r->core, r->shared_name) >= 0);
@@ -64,6 +71,7 @@ static void reserve_wrapper_free(pa_reserve_wrapper *r) {
pa_xfree(r);
}
+#ifdef HAVE_DBUS
static int request_cb(rd_device *d, int forced) {
pa_reserve_wrapper *r;
int k;
@@ -81,14 +89,17 @@ static int request_cb(rd_device *d, int forced) {
return k < 0 ? -1 : 1;
}
+#endif
pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name) {
pa_reserve_wrapper *r;
- DBusError error;
int k;
char *t;
+#ifdef HAVE_DBUS
+ DBusError error;
dbus_error_init(&error);
+#endif
pa_assert(c);
pa_assert(device_name);
@@ -112,6 +123,7 @@ pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name)
pa_assert_se(pa_shared_set(c, r->shared_name, r) >= 0);
+#ifdef HAVE_DBUS
if (!(r->connection = pa_dbus_bus_get(c, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) {
pa_log_warn("Unable to contact D-Bus session bus: %s: %s", error.name, error.message);
@@ -143,13 +155,15 @@ pa_reserve_wrapper* pa_reserve_wrapper_get(pa_core *c, const char *device_name)
rd_set_userdata(r->device, r);
return r;
-
fail:
dbus_error_free(&error);
reserve_wrapper_free(r);
return NULL;
+#else
+ return r;
+#endif
}
void pa_reserve_wrapper_unref(pa_reserve_wrapper *r) {
@@ -173,5 +187,7 @@ void pa_reserve_wrapper_set_application_device_name(pa_reserve_wrapper *r, const
pa_assert(r);
pa_assert(PA_REFCNT_VALUE(r) >= 1);
+#ifdef HAVE_DBUS
rd_set_application_device_name(r->device, name);
+#endif
}
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list