summaryrefslogtreecommitdiff
path: root/ext/pulse/pulsesrc.c
diff options
context:
space:
mode:
authorArun Raghavan <arun@arunraghavan.net>2016-09-08 17:30:41 +0530
committerArun Raghavan <arun@arunraghavan.net>2016-09-25 01:20:14 +0530
commit4833f02e47d5b7fc4284517e92d5976b20188a4a (patch)
tree267568e3aab518c2efeebacdd269c99aa79a0ed2 /ext/pulse/pulsesrc.c
parent10a16a632106a7ffdf7df50df5062497cff6d663 (diff)
pulsesrc: Don't negotiate to less than two segments
GstAudioRingBuffer doesn't needs us to have at least 2 segments. We make sure that if our buffer parameters are such that the maxlength is not at least 2x fragsize, we still request the ringbuffer to keep that much space so it continues to work. https://bugzilla.gnome.org/show_bug.cgi?id=770446
Diffstat (limited to 'ext/pulse/pulsesrc.c')
-rw-r--r--ext/pulse/pulsesrc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c
index 6ee2c506d..7af74ee6e 100644
--- a/ext/pulse/pulsesrc.c
+++ b/ext/pulse/pulsesrc.c
@@ -1595,6 +1595,9 @@ gst_pulsesrc_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
/* Fix up the total ringbuffer size based on what we actually got */
spec->segtotal = actual->maxlength / spec->segsize;
+ /* Don't buffer less than 2 segments as the ringbuffer can't deal with it */
+ if (spec->segtotal < 2)
+ spec->segtotal = 2;
if (!pulsesrc->paused) {
GST_DEBUG_OBJECT (pulsesrc, "uncorking because we are playing");