diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-04-10 16:24:33 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2011-05-15 10:09:35 +0530 |
commit | 62f56a9f6b01c277a8c4f15625473df4b73bd208 (patch) | |
tree | ee1248c8089e79a23f3e6c1188e44a7d2dc08ad6 /src/pulse/stream.c | |
parent | d1f13fa781ec69e4dbed000902123d255baaba5f (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/pulse/stream.c')
-rw-r--r-- | src/pulse/stream.c | 8 |
1 files changed, 8 insertions, 0 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); |