mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
pulsesrc: guard fragment size with a lower limit based on latency-time
In case that the pulse daemon runs the source device at a relatively low fixed fragment size compared to the requested latency-time, configure the ring buffer segsize to the largest integer multiple of the fragment size that is still smaller than or equal to the requested latency-time. Fixes bug #597463.
This commit is contained in:
parent
86b8935b07
commit
15c6175044
1 changed files with 5 additions and 2 deletions
|
@ -1014,8 +1014,11 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec)
|
||||||
GST_INFO_OBJECT (pulsesrc, "fragsize: %d (wanted %d)",
|
GST_INFO_OBJECT (pulsesrc, "fragsize: %d (wanted %d)",
|
||||||
actual->fragsize, wanted.fragsize);
|
actual->fragsize, wanted.fragsize);
|
||||||
|
|
||||||
/* adjust latency again */
|
if (actual->fragsize >= wanted.fragsize) {
|
||||||
spec->segsize = actual->fragsize;
|
spec->segsize = actual->fragsize;
|
||||||
|
} else {
|
||||||
|
spec->segsize = actual->fragsize * (wanted.fragsize / actual->fragsize);
|
||||||
|
}
|
||||||
spec->segtotal = actual->maxlength / spec->segsize;
|
spec->segtotal = actual->maxlength / spec->segsize;
|
||||||
|
|
||||||
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
pa_threaded_mainloop_unlock (pulsesrc->mainloop);
|
||||||
|
|
Loading…
Reference in a new issue