path: root/src/pulsecore/sink-input.c
diff options
authorArun Raghavan <>2011-04-10 16:24:33 +0530
committerArun Raghavan <>2011-05-15 10:09:35 +0530
commit62f56a9f6b01c277a8c4f15625473df4b73bd208 (patch)
treeee1248c8089e79a23f3e6c1188e44a7d2dc08ad6 /src/pulsecore/sink-input.c
parentd1f13fa781ec69e4dbed000902123d255baaba5f (diff)
sink-input: Provide more information to client when format is lost
When the sink format changes and we kill the stream, clients need a way to know (a) what device they should reconnect to, and (b) what the stream running time was when the stream got killed (pa_stream_get_time() won't work after the stream has been killed). This adds these two bits of information in the event callback's proplist parameter.
Diffstat (limited to 'src/pulsecore/sink-input.c')
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index f0558f40..b21cfae0 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1594,8 +1594,12 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, pa_bool_t save) {
if (pa_sink_input_is_passthrough(i) && !pa_sink_check_format(dest, i->format)) {
+ pa_proplist *p = pa_proplist_new();
pa_log_debug("New sink doesn't support stream format, sending format-changed and killing");
- pa_sink_input_send_event(i, PA_STREAM_EVENT_FORMAT_LOST, NULL);
+ /* Tell the client what device we want to be on if it is going to
+ * reconnect */
+ pa_proplist_sets(p, "device", dest->name);
+ pa_sink_input_send_event(i, PA_STREAM_EVENT_FORMAT_LOST, p);