+2004-11-12 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
+
+ * ext/alsa/gstalsasink.c: (gst_alsa_sink_loop):
+ Fix for negotiation order problem. This would show when the
+ ALSA loopfuction was called before any other function. ALSA
+ wouldn't do anything because we're not negotiated yet, leading
+ to an infinite loop. Showed in e.g. Rhythmbox. Fixes #158006.
+
2004-11-11 Tim-Philipp Müller <t.i.m@zen.co.uk>
reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
goto sink_restart;
if (avail < 0)
return;
- if (avail > 0) {
- /* Not enough space. We grab data nonetheless and sleep afterwards */
- if (avail < this->period_size) {
- avail = this->period_size;
- }
+ if (avail > 0 || (avail == 0 && !this->format)) {
+
+ bytes = G_MAXINT;
- /* check how many bytes we still have in all our bytestreams */
- /* initialize this value to a somewhat sane state, we might alloc
- * this much data below (which would be a bug, but who knows)... */
- bytes = this->period_size * this->period_count * element->numpads * 8; /* must be > max sample size in bytes */
for (i = 0; i < element->numpads; i++) {
GstBuffer *buf;
bytes = MIN (bytes, sink->size[i]);
}
+ /* check how many bytes we still have in all our bytestreams */
+ /* initialize this value to a somewhat sane state, we might alloc
+ * this much data below (which would be a bug, but who knows)... */
+ bytes = MIN (bytes,
+ this->period_size * this->period_count * element->numpads * 8);
+ /* must be > max sample size in bytes */
+
+ /* Not enough space. We grab data nonetheless and sleep afterwards */
+ if (avail < this->period_size)
+ avail = this->period_size;
avail = MIN (avail, gst_alsa_bytes_to_samples (this, bytes));
/* wait until the hw buffer has enough space */