mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
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.
This commit is contained in:
parent
d1f13fa781
commit
62f56a9f6b
2 changed files with 13 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue