[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test6-2-g75a8d18
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Mar 31 18:05:13 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 d9b19f870c4803aea7d6fc7f7bfc93f78b097435 (commit)
- Log -----------------------------------------------------------------
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
-----------------------------------------------------------------------
Summary of changes:
src/pulsecore/protocol-native.c | 20 ++++++++++----------
src/pulsecore/sink-input.c | 10 ++++++----
src/pulsecore/sink-input.h | 10 ++++++----
src/pulsecore/source-output.c | 10 ++++++----
src/pulsecore/source-output.h | 10 ++++++----
5 files changed, 34 insertions(+), 26 deletions(-)
-----------------------------------------------------------------------
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. */
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list