From e2f5779d2a918942d61e4ebf2acdc2ae5a97b5de Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Fri, 20 Apr 2012 11:32:59 +1000 Subject: gst player: clear the buffer pool when the video sink is stopped Buffers were kept allocated until the player is destroyed or next media played. Change-Id: I8a0c85da3a82ac6883075a1d0674143783c7f010 Reviewed-by: Michael Goddard --- src/gsttools/qvideosurfacegstsink.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gsttools') diff --git a/src/gsttools/qvideosurfacegstsink.cpp b/src/gsttools/qvideosurfacegstsink.cpp index 6347582a3..7f61a68e8 100644 --- a/src/gsttools/qvideosurfacegstsink.cpp +++ b/src/gsttools/qvideosurfacegstsink.cpp @@ -176,6 +176,13 @@ bool QVideoSurfaceGstDelegate::isActive() return !m_surface.isNull() && m_surface->isActive(); } +void QVideoSurfaceGstDelegate::clearPoolBuffers() +{ + QMutexLocker locker(&m_poolMutex); + if (m_pool) + m_pool->clear(); +} + GstFlowReturn QVideoSurfaceGstDelegate::render(GstBuffer *buffer) { if (!m_surface) { @@ -840,7 +847,8 @@ gboolean QVideoSurfaceGstSink::start(GstBaseSink *base) gboolean QVideoSurfaceGstSink::stop(GstBaseSink *base) { - Q_UNUSED(base); + VO_SINK(base); + sink->delegate->clearPoolBuffers(); return TRUE; } -- cgit v1.2.3