mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
bluetooth: don't hit an assert if latency is queried for a stooped recording stream
https://bugzilla.redhat.com/show_bug.cgi?id=537422
This commit is contained in:
parent
11688eca4b
commit
e7d9f891e2
1 changed files with 7 additions and 3 deletions
|
|
@ -972,10 +972,14 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
|
|||
case PA_SOURCE_MESSAGE_GET_LATENCY: {
|
||||
pa_usec_t wi, ri;
|
||||
|
||||
if (u->read_smoother) {
|
||||
wi = pa_smoother_get(u->read_smoother, pa_rtclock_now());
|
||||
ri = pa_bytes_to_usec(u->read_index, &u->sample_spec);
|
||||
|
||||
*((pa_usec_t*) data) = (wi > ri ? wi - ri : 0) + u->source->thread_info.fixed_latency;
|
||||
} else
|
||||
*((pa_usec_t*) data) = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue