Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio

This commit is contained in:
Lennart Poettering 2009-04-03 17:50:37 +02:00
commit 6152c52420
10 changed files with 60 additions and 46 deletions

View file

@ -26,7 +26,7 @@ m4_define(pa_major, [0])
m4_define(pa_minor, [9])
m4_define(pa_micro, [15])
AC_INIT([pulseaudio],[pa_major.pa_minor.pa_micro-test5],[mzchyfrnhqvb (at) 0pointer (dot) net])
AC_INIT([pulseaudio],[pa_major.pa_minor.pa_micro-test7],[mzchyfrnhqvb (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])

View file

@ -58,9 +58,9 @@ load-module module-detect
.endif
### Automatically load driver modules for Bluetooth hardware
#.ifexists module-bluetooth-discover@PA_SOEXT@
.ifexists module-bluetooth-discover@PA_SOEXT@
load-module module-bluetooth-discover
#.endif
.endif
### Load several protocols
.ifexists module-esound-protocol-unix@PA_SOEXT@

View file

@ -136,7 +136,7 @@ static void x11_kill_cb(pa_x11_wrapper *w, void *userdata) {
int pa__init(pa_module*m) {
struct userdata *u;
pa_modargs *ma = NULL;
char hn[256], un[128];
char *mid;
char hx[PA_NATIVE_COOKIE_LENGTH*2+1];
const char *t;
@ -164,10 +164,10 @@ int pa__init(pa_module*m) {
if (!(u->x11_wrapper = pa_x11_wrapper_get(m->core, pa_modargs_get_value(ma, "display", NULL))))
goto fail;
if (!pa_get_fqdn(hn, sizeof(hn)) || !pa_get_user_name(un, sizeof(un)))
goto fail;
mid = pa_machine_id();
u->id = pa_sprintf_malloc("%lu@%s/%lu", (unsigned long) getuid(), mid, (unsigned long) getpid());
pa_xfree(mid);
u->id = pa_sprintf_malloc("%s@%s/%u", un, hn, (unsigned) getpid());
pa_x11_set_prop(pa_x11_wrapper_get_display(u->x11_wrapper), "PULSE_ID", u->id);
publish_servers(u, pa_native_protocol_servers(u->protocol));

View file

@ -87,13 +87,15 @@ int pa_parse_address(const char *name, pa_parsed_address *ret_p) {
ret_p->type = PA_PARSED_ADDRESS_TCP_AUTO;
if (*name == '{') {
char hn[256], *pfx;
/* The URL starts with a host specification for detecting local connections */
char *id, *pfx;
if (!pa_get_host_name(hn, sizeof(hn)))
/* The URL starts with a host id for detecting local connections */
if (!(id = pa_machine_id()))
return -1;
pfx = pa_sprintf_malloc("{%s}", hn);
pfx = pa_sprintf_malloc("{%s}", id);
pa_xfree(id);
if (!pa_startswith(name, pfx)) {
pa_xfree(pfx);
/* Not local */

View file

@ -213,7 +213,7 @@ enum {
static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk);
static void sink_input_kill_cb(pa_sink_input *i);
static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend);
static void sink_input_moving_cb(pa_sink_input *i);
static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest);
static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes);
static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes);
static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes);
@ -225,7 +225,7 @@ static void playback_stream_request_bytes(struct playback_stream*s);
static void source_output_kill_cb(pa_source_output *o);
static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk);
static void source_output_suspend_cb(pa_source_output *o, pa_bool_t suspend);
static void source_output_moving_cb(pa_source_output *o);
static void source_output_moving_cb(pa_source_output *o, pa_source *dest);
static pa_usec_t source_output_get_latency_cb(pa_source_output *o);
static void source_output_send_event_cb(pa_source_output *o, const char *event, pa_proplist *pl);
@ -1572,7 +1572,7 @@ static void sink_input_suspend_cb(pa_sink_input *i, pa_bool_t suspend) {
}
/* Called from main context */
static void sink_input_moving_cb(pa_sink_input *i) {
static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
playback_stream *s;
pa_tagstruct *t;
@ -1591,9 +1591,9 @@ static void sink_input_moving_cb(pa_sink_input *i) {
pa_tagstruct_putu32(t, PA_COMMAND_PLAYBACK_STREAM_MOVED);
pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
pa_tagstruct_putu32(t, s->index);
pa_tagstruct_putu32(t, i->sink->index);
pa_tagstruct_puts(t, i->sink->name);
pa_tagstruct_put_boolean(t, pa_sink_get_state(i->sink) == PA_SINK_SUSPENDED);
pa_tagstruct_putu32(t, dest->index);
pa_tagstruct_puts(t, dest->name);
pa_tagstruct_put_boolean(t, pa_sink_get_state(dest) == PA_SINK_SUSPENDED);
if (s->connection->version >= 13) {
pa_tagstruct_putu32(t, s->buffer_attr.maxlength);
@ -1685,7 +1685,7 @@ static void source_output_suspend_cb(pa_source_output *o, pa_bool_t suspend) {
}
/* Called from main context */
static void source_output_moving_cb(pa_source_output *o) {
static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
record_stream *s;
pa_tagstruct *t;
@ -1705,9 +1705,9 @@ static void source_output_moving_cb(pa_source_output *o) {
pa_tagstruct_putu32(t, PA_COMMAND_RECORD_STREAM_MOVED);
pa_tagstruct_putu32(t, (uint32_t) -1); /* tag */
pa_tagstruct_putu32(t, s->index);
pa_tagstruct_putu32(t, o->source->index);
pa_tagstruct_puts(t, o->source->name);
pa_tagstruct_put_boolean(t, pa_source_get_state(o->source) == PA_SOURCE_SUSPENDED);
pa_tagstruct_putu32(t, dest->index);
pa_tagstruct_puts(t, dest->name);
pa_tagstruct_put_boolean(t, pa_source_get_state(dest) == PA_SOURCE_SUSPENDED);
if (s->connection->version >= 13) {
pa_tagstruct_putu32(t, s->buffer_attr.maxlength);

View file

@ -845,10 +845,12 @@ pa_usec_t pa_sink_input_set_requested_latency(pa_sink_input *i, pa_usec_t usec)
/* If this sink input is not realized yet or we are being moved,
* we have to touch the thread info data directly */
pa_sink_get_latency_range(i->sink, &min_latency, &max_latency);
if (i->sink) {
pa_sink_get_latency_range(i->sink, &min_latency, &max_latency);
if (usec != (pa_usec_t) -1)
usec = PA_CLAMP(usec, min_latency, max_latency);
if (usec != (pa_usec_t) -1)
usec = PA_CLAMP(usec, min_latency, max_latency);
}
i->thread_info.requested_sink_latency = usec;
@ -1165,7 +1167,7 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, pa_bool_t save) {
new_resampler = NULL;
if (i->moving)
i->moving(i);
i->moving(i, dest);
i->sink = dest;
i->save_sink = save;

View file

@ -144,13 +144,15 @@ struct pa_sink_input {
* disconnected from its sink. Called from IO thread context */
void (*detach) (pa_sink_input *i); /* may be NULL */
/* If non-NULL called whenever the the sink this input is attached
/* If non-NULL called whenever the sink this input is attached
* to suspends or resumes. Called from main context */
void (*suspend) (pa_sink_input *i, pa_bool_t b); /* may be NULL */
/* If non-NULL called whenever the the sink this input is attached
* to changes. Called from main context */
void (*moving) (pa_sink_input *i); /* may be NULL */
/* If non-NULL called whenever the sink input is moved to a new
* sink. Called from main context after the sink input has been
* detached from the old sink and before it has been attached to
* the new sink. */
void (*moving) (pa_sink_input *i, pa_sink *dest); /* may be NULL */
/* Supposed to unlink and destroy this stream. Called from main
* context. */

View file

@ -467,11 +467,13 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
pa_snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.sin6_port));
} else if (memcmp(&in6addr_loopback, &sa.sin6_addr, sizeof(in6addr_loopback)) == 0) {
char hn[256];
if (!pa_get_host_name(hn, sizeof(hn)))
char *id;
if (!(id = pa_machine_id()))
return NULL;
pa_snprintf(c, l, "{%s}tcp6:localhost:%u", hn, (unsigned) ntohs(sa.sin6_port));
pa_snprintf(c, l, "{%s}tcp6:localhost:%u", id, (unsigned) ntohs(sa.sin6_port));
pa_xfree(id);
} else {
char ip[INET6_ADDRSTRLEN];
@ -503,11 +505,13 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
pa_snprintf(c, l, "tcp:%s:%u", fqdn, (unsigned) ntohs(sa.sin_port));
} else if (sa.sin_addr.s_addr == INADDR_LOOPBACK) {
char hn[256];
if (!pa_get_host_name(hn, sizeof(hn)))
char *id;
if (!(id = pa_machine_id()))
return NULL;
pa_snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) ntohs(sa.sin_port));
pa_snprintf(c, l, "{%s}tcp:localhost:%u", id, (unsigned) ntohs(sa.sin_port));
pa_xfree(id);
} else {
char ip[INET_ADDRSTRLEN];
@ -523,15 +527,15 @@ char *pa_socket_server_get_address(pa_socket_server *s, char *c, size_t l) {
}
case SOCKET_SERVER_UNIX: {
char hn[256];
char *id;
if (!s->filename)
return NULL;
if (!pa_get_host_name(hn, sizeof(hn)))
if (!(id = pa_machine_id()))
return NULL;
pa_snprintf(c, l, "{%s}unix:%s", hn, s->filename);
pa_snprintf(c, l, "{%s}unix:%s", id, s->filename);
return c;
}

View file

@ -542,10 +542,12 @@ pa_usec_t pa_source_output_set_requested_latency(pa_source_output *o, pa_usec_t
/* If this source output is not realized yet or is being moved, we
* have to touch the thread info data directly */
pa_source_get_latency_range(o->source, &min_latency, &max_latency);
if (o->source) {
pa_source_get_latency_range(o->source, &min_latency, &max_latency);
if (usec != (pa_usec_t) -1)
usec = PA_CLAMP(usec, min_latency, max_latency);
if (usec != (pa_usec_t) -1)
usec = PA_CLAMP(usec, min_latency, max_latency);
}
o->thread_info.requested_source_latency = usec;
@ -745,7 +747,7 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest, pa_bool_t
new_resampler = NULL;
if (o->moving)
o->moving(o);
o->moving(o, dest);
o->source = dest;
o->save_source = save;

View file

@ -116,13 +116,15 @@ struct pa_source_output {
* disconnected from its source. Called from IO thread context */
void (*detach) (pa_source_output *o); /* may be NULL */
/* If non-NULL called whenever the the source this output is attached
/* If non-NULL called whenever the source this output is attached
* to suspends or resumes. Called from main context */
void (*suspend) (pa_source_output *o, pa_bool_t b); /* may be NULL */
/* If non-NULL called whenever the the source this output is attached
* to changes. Called from main context */
void (*moving) (pa_source_output *o); /* may be NULL */
/* If non-NULL called whenever the source output is moved to a new
* source. Called from main context after the stream was detached
* from the old source and before it is attached to the new
* source. */
void (*moving) (pa_source_output *o, pa_source *dest); /* may be NULL */
/* Supposed to unlink and destroy this stream. Called from main
* context. */