mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
pulsesink: Don't request more shared memory than needed
This commit is contained in:
parent
bb72770c03
commit
4113a1dad1
1 changed files with 10 additions and 4 deletions
|
@ -1325,6 +1325,15 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
|
||||||
goto was_paused;
|
goto was_paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure we only buffer up latency-time samples */
|
||||||
|
if (pbuf->m_writable > buf->spec.segsize) {
|
||||||
|
/* limit buffering to latency-time value */
|
||||||
|
pbuf->m_writable = buf->spec.segsize;
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (psink, "Limiting buffering to %" G_GSIZE_FORMAT,
|
||||||
|
pbuf->m_writable);
|
||||||
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (psink, "requesting %u bytes of shared memory",
|
GST_LOG_OBJECT (psink, "requesting %u bytes of shared memory",
|
||||||
pbuf->m_writable);
|
pbuf->m_writable);
|
||||||
if (pa_stream_begin_write (pbuf->stream, &pbuf->m_data,
|
if (pa_stream_begin_write (pbuf->stream, &pbuf->m_data,
|
||||||
|
@ -1334,13 +1343,10 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
|
||||||
}
|
}
|
||||||
GST_LOG_OBJECT (psink, "got %u bytes of shared memory", pbuf->m_writable);
|
GST_LOG_OBJECT (psink, "got %u bytes of shared memory", pbuf->m_writable);
|
||||||
|
|
||||||
/* make sure we only buffer up latency-time samples */
|
/* Just to make sure that we didn't get more than requested */
|
||||||
if (pbuf->m_writable > buf->spec.segsize) {
|
if (pbuf->m_writable > buf->spec.segsize) {
|
||||||
/* limit buffering to latency-time value */
|
/* limit buffering to latency-time value */
|
||||||
pbuf->m_writable = buf->spec.segsize;
|
pbuf->m_writable = buf->spec.segsize;
|
||||||
|
|
||||||
GST_LOG_OBJECT (psink, "Limiting buffering to %" G_GSIZE_FORMAT,
|
|
||||||
pbuf->m_writable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue