GST_LOG_OBJECT (psink, "discontinuity, offset is %" G_GINT64_FORMAT ", "
"last offset was %" G_GINT64_FORMAT, offset, pbuf->m_lastoffset);
- towrite = out_samples * bps;
+ towrite = out_samples * bpf;
- /* Only ever write segsize bytes at once. This will
- * also limit the PA shm buffer to segsize
- */
+ /* Wait for at least segsize bytes to become available */
if (towrite > buf->spec.segsize)
towrite = buf->spec.segsize;
GST_LOG_OBJECT (psink, "got %" G_GSIZE_FORMAT " bytes of shared memory",
pbuf->m_writable);
- /* Just to make sure that we didn't get more than requested */
- if (pbuf->m_writable > buf->spec.segsize) {
- /* limit buffering to latency-time value */
- pbuf->m_writable = buf->spec.segsize;
- }
}
- if (pbuf->m_writable < towrite)
+ if (towrite > pbuf->m_writable)
towrite = pbuf->m_writable;
- avail = towrite / bps;
+ avail = towrite / bpf;
GST_LOG_OBJECT (psink, "writing %u samples at offset %" G_GUINT64_FORMAT,
(guint) avail, offset);