diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-01-13 21:33:11 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-01-13 21:33:11 +0100 |
commit | 4b1679e06d3b4ed98ed8e934db8c0fe99877a56c (patch) | |
tree | a5acf07ac7ca5190863dc12aba3d67b8b08a0b8b /src | |
parent | ba255bfc42c4637b5a541b419112b30cf21e8fb5 (diff) | |
parent | f1d1447e104c4f609c0e8c528b56ea6afa540b95 (diff) |
Merge remote branch 'tanuk/fixes'
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 12 | ||||
-rw-r--r-- | src/daemon/main.c | 30 | ||||
-rw-r--r-- | src/pulsecore/idxset.h | 2 | ||||
-rw-r--r-- | src/pulsecore/sink-input.c | 2 |
4 files changed, 38 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 9ff06ec5..2978b8f7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -633,6 +633,12 @@ libpulsecommon_@PA_MAJORMINORMICRO@_la_CFLAGS = $(AM_CFLAGS) libpulsecommon_@PA_MAJORMINORMICRO@_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version libpulsecommon_@PA_MAJORMINORMICRO@_la_LIBADD = $(AM_LIBADD) $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) $(LIBSNDFILE_LIBS) +if HAVE_X11 +libpulsecommon_@PA_MAJORMINORMICRO@_la_SOURCES += pulse/client-conf-x11.c pulse/client-conf-x11.h +libpulsecommon_@PA_MAJORMINORMICRO@_la_CFLAGS += $(X11_CFLAGS) +libpulsecommon_@PA_MAJORMINORMICRO@_la_LDFLAGS += $(X11_LIBS) +endif + # proplist-util.h uses these header files, but not the library itself! libpulsecommon_@PA_MAJORMINORMICRO@_la_CFLAGS += $(GLIB20_CFLAGS) $(GTK20_CFLAGS) @@ -773,12 +779,6 @@ libpulse_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) libpulse_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) $(LTLIBICONV) libpulsecommon-@PA_MAJORMINORMICRO@.la libpulse_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO) -if HAVE_X11 -libpulse_la_SOURCES += pulse/client-conf-x11.c pulse/client-conf-x11.h -libpulse_la_CFLAGS += $(X11_CFLAGS) -libpulse_la_LDFLAGS += $(X11_LIBS) -endif - libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h libpulse_simple_la_CFLAGS = $(AM_CFLAGS) libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon-@PA_MAJORMINORMICRO@.la diff --git a/src/daemon/main.c b/src/daemon/main.c index e6568364..5ccda779 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -63,6 +63,10 @@ #include <dbus/dbus.h> #endif +#include <pulse/client-conf.h> +#ifdef HAVE_X11 +#include <pulse/client-conf-x11.h> +#endif #include <pulse/mainloop.h> #include <pulse/mainloop-signal.h> #include <pulse/timeval.h> @@ -343,6 +347,24 @@ static void set_all_rlimits(const pa_daemon_conf *conf) { } #endif +static char *check_configured_address(void) { + char *default_server = NULL; + pa_client_conf *c = pa_client_conf_new(); + + pa_client_conf_load(c, NULL); +#ifdef HAVE_X11 + pa_client_conf_from_x11(c, NULL); +#endif + pa_client_conf_env(c); + + if (c->default_server && *c->default_server) + default_server = pa_xstrdup(c->default_server); + + pa_client_conf_free(c); + + return default_server; +} + #ifdef HAVE_DBUS static pa_dbus_connection *register_dbus_name(pa_core *c, DBusBusType bus, const char* name) { DBusError error; @@ -383,6 +405,7 @@ int main(int argc, char *argv[]) { pa_daemon_conf *conf = NULL; pa_mainloop *mainloop = NULL; char *s; + char *configured_address; int r = 0, retval = 1, d = 0; pa_bool_t valid_pid_file = FALSE; pa_bool_t ltdl_init = FALSE; @@ -649,6 +672,13 @@ int main(int argc, char *argv[]) { goto finish; } + if (conf->cmd == PA_CMD_START && (configured_address = check_configured_address())) { + pa_log_notice(_("User-configured server at %s, not autospawning."), configured_address); + pa_xfree(configured_address); + retval = 0; + goto finish; + } + if (conf->system_instance && !conf->disallow_exit) pa_log_warn(_("Running in system mode, but --disallow-exit not set!")); diff --git a/src/pulsecore/idxset.h b/src/pulsecore/idxset.h index d1e68c5c..2d01fb47 100644 --- a/src/pulsecore/idxset.h +++ b/src/pulsecore/idxset.h @@ -65,7 +65,7 @@ int pa_idxset_put(pa_idxset*s, void *p, uint32_t *idx); /* Get the entry by its idx */ void* pa_idxset_get_by_index(pa_idxset*s, uint32_t idx); -/* Get the entry by its data. The idx is returned in *index */ +/* Get the entry by its data. The index is returned in *idx */ void* pa_idxset_get_by_data(pa_idxset*s, const void *p, uint32_t *idx); /* Similar to pa_idxset_get_by_index(), but removes the entry from the idxset. */ diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index a4902909..c75d4176 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -1769,7 +1769,7 @@ static void sink_input_rewind_ramp_info(pa_sink_input *i, size_t nbytes) { if (!i->thread_info.ramp_info.envelope_dead) { int32_t envelope_length; - pa_assert(i->thread_info.ramp_info.envelope); + pa_assert(i->thread_info.ramp_info.envelope); envelope_length = pa_envelope_length(i->thread_info.ramp_info.envelope); |