summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pulse/stream.c8
-rw-r--r--src/pulsecore/sink-input.c6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index bd2e6ca1..6c055a5c 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -766,6 +766,14 @@ void pa_command_stream_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
if (s->state != PA_STREAM_READY)
goto finish;
+ if (pa_streq(event, PA_STREAM_EVENT_FORMAT_LOST)) {
+ /* Let client know what the running time was when the stream had to be
+ * killed */
+ pa_usec_t time;
+ if (pa_stream_get_time(s, &time) == 0)
+ pa_proplist_setf(pl, "stream-time", "%llu", (unsigned long long) time);
+ }
+
if (s->event_callback)
s->event_callback(s, event, pl, s->event_userdata);
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) {
return -PA_ERR_NOTSUPPORTED;
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);
return -PA_ERR_NOTSUPPORTED;
}