summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-07-02 10:31:49 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-07-02 10:33:15 +0200
commit25974ac0a97e28e59a6f0aa95ec1b52acf636fa2 (patch)
treef91a60f9196a540a881665839f40e12016edad6d
parent28d250ec3f5463d801b1112794d6f0f22a36e61d (diff)
downloadgstreamer-plugins-bad-25974ac0a97e28e59a6f0aa95ec1b52acf636fa2.tar.gz
d3dvideosink: Don't leak all surfaces
This was broken when disabling the buffer pool exporting. Also disable buffer pool a bit more efficient...
-rw-r--r--sys/d3dvideosink/d3dhelpers.c6
-rw-r--r--sys/d3dvideosink/d3dvideosink.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c
index c9b0d1b71..03ed6ee96 100644
--- a/sys/d3dvideosink/d3dhelpers.c
+++ b/sys/d3dvideosink/d3dhelpers.c
@@ -1881,13 +1881,9 @@ d3d_render_buffer (GstD3DVideoSink * sink, GstBuffer * buf)
surface = ((GstD3DSurfaceMemory *) mem)->surface;
-#ifndef DISABLE_BUFFER_POOL
/* Need to keep an additional ref until the next buffer
* to make sure it isn't reused until then */
sink->fallback_buffer = buf;
-#else
- sink->fallback_buffer = NULL;
-#endif
} else {
mem = gst_buffer_peek_memory (buf, 0);
surface = ((GstD3DSurfaceMemory *) mem)->surface;
@@ -1900,9 +1896,7 @@ d3d_render_buffer (GstD3DVideoSink * sink, GstBuffer * buf)
if (sink->d3d.surface)
IDirect3DSurface9_Release (sink->d3d.surface);
-#ifndef DISABLE_BUFFER_POOL
IDirect3DSurface9_AddRef (surface);
-#endif
sink->d3d.surface = surface;
if (!d3d_present_swap_chain (sink)) {
diff --git a/sys/d3dvideosink/d3dvideosink.c b/sys/d3dvideosink/d3dvideosink.c
index 09ced0857..556807505 100644
--- a/sys/d3dvideosink/d3dvideosink.c
+++ b/sys/d3dvideosink/d3dvideosink.c
@@ -472,6 +472,10 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);
+#ifdef DISABLE_BUFFER_POOL
+ return TRUE;
+#endif
+
GST_OBJECT_LOCK (sink);
pool = sink->pool ? gst_object_ref (sink->pool) : NULL;
GST_OBJECT_UNLOCK (sink);
@@ -520,9 +524,7 @@ gst_d3dvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (pool) {
/* we need at least 2 buffer because we hold on to the last one */
-#ifndef DISABLE_BUFFER_POOL
gst_query_add_allocation_pool (query, pool, size, 2, 0);
-#endif
gst_object_unref (pool);
}