[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master-tx, updated. v0.9.15-test7
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Mar 31 18:33:16 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-tx branch has been updated
from 2a32de1eaa15624b3d773115d849dba863ca5a44 (commit)
- Log -----------------------------------------------------------------
707acab prepare test7
75a8d18 pass destination source/sink when moving streams so that we can access them
c2f6d09 don't access i->sink if it is not set
d9b19f8 prepare test6
5348cc1 increase timing update interval exponentially
aa1ad0d in verbose mode log buffer attr changes
0aa99c4 add buffer_attr callback stuff to exported symbol list
4e8ceae fix buffer defaults
76c44d1 be a bit more verbose about max_request changes
cebaa98 Log underruns
917e8cd handle buffer_attr changed messages properly
5cbd4b7 update command name table
ef5af55 fix an error where a signal was accidently freed when it is tried to register it twice
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
src/map-file | 1 +
src/modules/module-tunnel.c | 56 ++++++++++++++++++++++++++++++++++++---
src/pulse/internal.h | 1 +
src/pulse/mainloop-signal.c | 5 +--
src/pulse/stream.c | 17 +++++++++---
src/pulsecore/pdispatch.c | 15 +++++++++-
src/pulsecore/protocol-native.c | 41 +++++++++++++++++-----------
src/pulsecore/sink-input.c | 10 ++++---
src/pulsecore/sink-input.h | 10 ++++---
src/pulsecore/source-output.c | 10 ++++---
src/pulsecore/source-output.h | 10 ++++---
src/utils/pacat.c | 8 +++++
13 files changed, 141 insertions(+), 45 deletions(-)
-----------------------------------------------------------------------
commit ef5af553d6bb27d88a97f407fcf9f685f7e36e49
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 20:31:15 2009 +0200
fix an error where a signal was accidently freed when it is tried to register it twice
diff --git a/src/pulse/mainloop-signal.c b/src/pulse/mainloop-signal.c
index 52f11c8..3dc7439 100644
--- a/src/pulse/mainloop-signal.c
+++ b/src/pulse/mainloop-signal.c
@@ -170,7 +170,7 @@ pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t _callback, void *userdata
for (e = signals; e; e = e->next)
if (e->sig == sig)
- goto fail;
+ return NULL;
e = pa_xnew(pa_signal_event, 1);
e->sig = sig;
@@ -196,8 +196,7 @@ pa_signal_event* pa_signal_new(int sig, pa_signal_cb_t _callback, void *userdata
return e;
fail:
- if (e)
- pa_xfree(e);
+ pa_xfree(e);
return NULL;
}
commit 5cbd4b74a2248a701b00b316f47dc22617d81f3d
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 20:43:05 2009 +0200
update command name table
diff --git a/src/pulsecore/pdispatch.c b/src/pulsecore/pdispatch.c
index 305941a..d00106b 100644
--- a/src/pulsecore/pdispatch.c
+++ b/src/pulsecore/pdispatch.c
@@ -165,7 +165,20 @@ static const char *command_names[PA_COMMAND_MAX] = {
[PA_COMMAND_STARTED] = "STARTED",
/* Supported since protocol v14 (0.9.12) */
- [PA_COMMAND_EXTENSION] = "EXTENSION"
+ [PA_COMMAND_EXTENSION] = "EXTENSION",
+
+
+ [PA_COMMAND_GET_CARD_INFO] = "GET_CARD_INFO",
+ [PA_COMMAND_GET_CARD_INFO_LIST] = "GET_CARD_INFO_LIST",
+ [PA_COMMAND_SET_CARD_PROFILE] = "SET_CARD_PROFILE",
+
+ [PA_COMMAND_CLIENT_EVENT] = "GET_CLIENT_EVENT",
+ [PA_COMMAND_PLAYBACK_STREAM_EVENT] = "PLAYBACK_STREAM_EVENT",
+ [PA_COMMAND_RECORD_STREAM_EVENT] = "RECORD_STREAM_EVENT",
+
+ /* SERVER->CLIENT */
+ [PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED] = "PLAYBACK_BUFFER_ATTR_CHANGED",
+ [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = "RECORD_BUFFER_ATTR_CHANGED"
};
#endif
commit 917e8cd0f619c2be0a2e6c38216508c62c56f7e7
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:35:34 2009 +0200
handle buffer_attr changed messages properly
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 7f303f1..79facdd 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -146,6 +146,7 @@ static void command_overflow_or_underflow(pa_pdispatch *pd, uint32_t command, ui
static void command_suspended(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static void command_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static void command_stream_or_client_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
+static void command_stream_buffer_attr_changed(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
static const pa_pdispatch_cb_t command_table[PA_COMMAND_MAX] = {
#ifdef TUNNEL_SINK
@@ -163,7 +164,9 @@ static const pa_pdispatch_cb_t command_table[PA_COMMAND_MAX] = {
[PA_COMMAND_RECORD_STREAM_MOVED] = command_moved,
[PA_COMMAND_PLAYBACK_STREAM_EVENT] = command_stream_or_client_event,
[PA_COMMAND_RECORD_STREAM_EVENT] = command_stream_or_client_event,
- [PA_COMMAND_CLIENT_EVENT] = command_stream_or_client_event
+ [PA_COMMAND_CLIENT_EVENT] = command_stream_or_client_event,
+ [PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED] = command_stream_buffer_attr_changed,
+ [PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED] = command_stream_buffer_attr_changed
};
struct userdata {
@@ -320,6 +323,51 @@ static void command_moved(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa
request_latency(u);
}
+static void command_stream_buffer_attr_changed(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
+ struct userdata *u = userdata;
+ uint32_t channel, maxlength, tlength, fragsize, prebuf, minreq;
+ pa_usec_t usec;
+
+ pa_assert(pd);
+ pa_assert(t);
+ pa_assert(u);
+ pa_assert(u->pdispatch == pd);
+
+ if (pa_tagstruct_getu32(t, &channel) < 0 ||
+ pa_tagstruct_getu32(t, &maxlength) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+
+ if (command == PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED) {
+ if (pa_tagstruct_getu32(t, &fragsize) < 0 ||
+ pa_tagstruct_get_usec(t, &usec) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+ } else {
+ if (pa_tagstruct_getu32(t, &tlength) < 0 ||
+ pa_tagstruct_getu32(t, &prebuf) < 0 ||
+ pa_tagstruct_getu32(t, &minreq) < 0 ||
+ pa_tagstruct_get_usec(t, &usec) < 0) {
+
+ pa_log_error("Invalid packet.");
+ pa_module_unload_request(u->module, TRUE);
+ return;
+ }
+ }
+
+#ifdef TUNNEL_SINK
+ pa_log_debug("Server reports buffer attrs changed. tlength now at %lu, before %lu.", (unsigned long) tlength, (unsigned long) u->tlength);
+#endif
+
+ request_latency(u);
+}
+
#ifdef TUNNEL_SINK
/* Called from main context */
commit cebaa98b384c94c910739691a1901b935b64cb4e
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:36:09 2009 +0200
Log underruns
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 3e75cab..09ac7d2 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1437,7 +1437,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
if (pa_memblockq_is_readable(s->memblockq))
s->is_underrun = FALSE;
else {
-/* pa_log("%s, UNDERRUN: %lu", pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME), (unsigned long) pa_memblockq_get_length(s->memblockq)); */
+ pa_log_debug("Underrun on '%s', %lu bytes in queue.", pa_strnull(pa_proplist_gets(i->proplist, PA_PROP_MEDIA_NAME)), (unsigned long) pa_memblockq_get_length(s->memblockq));
if (s->drain_request && pa_sink_input_safe_to_remove(i)) {
s->drain_request = FALSE;
commit 76c44d104d8f4ec8729f9601bbad828bd39e253c
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 21:36:45 2009 +0200
be a bit more verbose about max_request changes
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 09ac7d2..4f1d9b4 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1495,17 +1495,26 @@ static void sink_input_update_max_rewind_cb(pa_sink_input *i, size_t nbytes) {
/* Called from thread context */
static void sink_input_update_max_request_cb(pa_sink_input *i, size_t nbytes) {
playback_stream *s;
- size_t tlength;
+ size_t new_tlength, old_tlength;
pa_sink_input_assert_ref(i);
s = PLAYBACK_STREAM(i->userdata);
playback_stream_assert_ref(s);
- tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
+ old_tlength = pa_memblockq_get_tlength(s->memblockq);
+ new_tlength = nbytes+2*pa_memblockq_get_minreq(s->memblockq);
- if (pa_memblockq_get_tlength(s->memblockq) < tlength) {
- pa_memblockq_set_tlength(s->memblockq, tlength);
- pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ if (old_tlength < new_tlength) {
+ pa_log_debug("max_request changed, trying to update from %zu to %zu.", old_tlength, new_tlength);
+ pa_memblockq_set_tlength(s->memblockq, new_tlength);
+ new_tlength = pa_memblockq_get_tlength(s->memblockq);
+
+ if (new_tlength == old_tlength)
+ pa_log_debug("Failed to increase tlength");
+ else {
+ pa_log_debug("Notifying client about increased tlength");
+ pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(s), PLAYBACK_STREAM_MESSAGE_UPDATE_TLENGTH, NULL, pa_memblockq_get_tlength(s->memblockq), NULL, NULL);
+ }
}
}
commit 4e8ceae064758bc5ea8b541e8c7ceb804fc48d5d
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Mar 31 22:16:53 2009 +0200
fix buffer defaults
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 79facdd..1d658ba 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -1926,11 +1926,11 @@ int pa__init(pa_module*m) {
u->time_event = NULL;
- u->maxlength = 0;
+ u->maxlength = (uint32_t) -1;
#ifdef TUNNEL_SINK
- u->tlength = u->minreq = u->prebuf = 0;
+ u->tlength = u->minreq = u->prebuf = (uint32_t) -1;
#else
- u->fragsize = 0;
+ u->fragsize = (uint32_t) -1;
#endif
pa_smoother_set_time_offset(u->smoother, pa_rtclock_usec());
commit 0aa99c48d014d38347e8b9a85252ca9c450627bd
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 00:33:40 2009 +0200
add buffer_attr callback stuff to exported symbol list
diff --git a/src/map-file b/src/map-file
index d949659..d0102ae 100644
--- a/src/map-file
+++ b/src/map-file
@@ -233,6 +233,7 @@ pa_stream_proplist_update;
pa_stream_readable_size;
pa_stream_ref;
pa_stream_set_buffer_attr;
+pa_stream_set_buffer_attr_callback;
pa_stream_set_event_callback;
pa_stream_set_latency_update_callback;
pa_stream_set_monitor_stream;
commit aa1ad0df188f308f00a7b648d0d4b64322eaed64
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 00:35:37 2009 +0200
in verbose mode log buffer attr changes
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index e886c15..180de48 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -238,6 +238,13 @@ static void stream_moved_callback(pa_stream *s, void *userdata) {
fprintf(stderr, _("Stream moved to device %s (%u, %ssuspended).%s \n"), pa_stream_get_device_name(s), pa_stream_get_device_index(s), pa_stream_is_suspended(s) ? "" : _("not "), CLEAR_LINE);
}
+static void stream_buffer_attr_callback(pa_stream *s, void *userdata) {
+ assert(s);
+
+ if (verbose)
+ fprintf(stderr, _("Stream buffer attributes changed.%s \n"), CLEAR_LINE);
+}
+
static void stream_event_callback(pa_stream *s, const char *name, pa_proplist *pl, void *userdata) {
char *t;
@@ -284,6 +291,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
pa_stream_set_overflow_callback(stream, stream_overflow_callback, NULL);
pa_stream_set_started_callback(stream, stream_started_callback, NULL);
pa_stream_set_event_callback(stream, stream_event_callback, NULL);
+ pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL);
if (latency > 0) {
memset(&buffer_attr, 0, sizeof(buffer_attr));
commit 5348cc1275255fe423ca228f30c395a1e832811e
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 00:36:18 2009 +0200
increase timing update interval exponentially
diff --git a/src/pulse/internal.h b/src/pulse/internal.h
index da94faa..cf362d9 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.h
@@ -166,6 +166,7 @@ struct pa_stream {
/* Latency interpolation stuff */
pa_time_event *auto_timing_update_event;
+ pa_usec_t auto_timing_interval_usec;
pa_smoother *smoother;
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index bb53b19..16342ca 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -41,7 +41,8 @@
#include "fork-detect.h"
#include "internal.h"
-#define LATENCY_IPOL_INTERVAL_USEC (333*PA_USEC_PER_MSEC)
+#define AUTO_TIMING_INTERVAL_START_USEC (10*PA_USEC_PER_MSEC)
+#define AUTO_TIMING_INTERVAL_END_USEC (1500*PA_USEC_PER_MSEC)
#define SMOOTHER_ADJUST_TIME (1000*PA_USEC_PER_MSEC)
#define SMOOTHER_HISTORY_TIME (5000*PA_USEC_PER_MSEC)
@@ -161,6 +162,7 @@ pa_stream *pa_stream_new_with_proplist(
s->auto_timing_update_event = NULL;
s->auto_timing_update_requested = FALSE;
+ s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
reset_callbacks(s);
@@ -308,7 +310,7 @@ static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
(force || !s->auto_timing_update_requested)) {
pa_operation *o;
-/* pa_log("automatically requesting new timing data"); */
+/* pa_log("Automatically requesting new timing data"); */
if ((o = pa_stream_update_timing_info(s, NULL, NULL))) {
pa_operation_unref(o);
@@ -318,9 +320,15 @@ static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
if (s->auto_timing_update_event) {
struct timeval next;
+
+ if (force)
+ s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
+
pa_gettimeofday(&next);
- pa_timeval_add(&next, LATENCY_IPOL_INTERVAL_USEC);
+ pa_timeval_add(&next, s->auto_timing_interval_usec);
s->mainloop->time_restart(s->auto_timing_update_event, &next);
+
+ s->auto_timing_interval_usec = PA_MIN(AUTO_TIMING_INTERVAL_END_USEC, s->auto_timing_interval_usec*2);
}
}
@@ -823,7 +831,8 @@ static void create_stream_complete(pa_stream *s) {
if (s->flags & PA_STREAM_AUTO_TIMING_UPDATE) {
struct timeval tv;
pa_gettimeofday(&tv);
- tv.tv_usec += (suseconds_t) LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
+ s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
+ pa_timeval_add(&tv, s->auto_timing_interval_usec);
pa_assert(!s->auto_timing_update_event);
s->auto_timing_update_event = s->mainloop->time_new(s->mainloop, &tv, &auto_timing_update_callback, s);
commit d9b19f870c4803aea7d6fc7f7bfc93f78b097435
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 00:43:29 2009 +0200
prepare test6
diff --git a/configure.ac b/configure.ac
index 029899c..98ab962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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-test6],[mzchyfrnhqvb (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
commit c2f6d090c795bba9ef405908cee06bba79a87f1f
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 03:03:20 2009 +0200
don't access i->sink if it is not set
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index da42242..537f198 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -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;
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 550b657..5c24006 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -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;
commit 75a8d18285f247b8a15dda8a3b545455d564d119
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 03:04:39 2009 +0200
pass destination source/sink when moving streams so that we can access them
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 4f1d9b4..e11d7a6 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -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);
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 537f198..0ed16dd 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1167,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;
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index 4e29be6..e7a555d 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.h
@@ -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. */
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 5c24006..27f24cd 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -747,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;
diff --git a/src/pulsecore/source-output.h b/src/pulsecore/source-output.h
index 8d57ded..9f5f774 100644
--- a/src/pulsecore/source-output.h
+++ b/src/pulsecore/source-output.h
@@ -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. */
commit 707acabde53666fde490b489ec2e7b87eee5e8a4
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Apr 1 03:09:10 2009 +0200
prepare test7
diff --git a/configure.ac b/configure.ac
index 98ab962..097f0a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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-test6],[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])
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list