summaryrefslogtreecommitdiff
path: root/ext/wayland
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-02-14 17:20:42 +0100
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-06-17 13:51:22 +0200
commite7650117afa3fef9b49607570453ba2fc85907f5 (patch)
tree2d8c0ece9fcb874b5ae8e2a1bb3f7f2a681fa06a /ext/wayland
parent58a4d247b3d8a87addb5c41eb3ad5c699469866b (diff)
downloadgstreamer-plugins-bad-e7650117afa3fef9b49607570453ba2fc85907f5.tar.gz
waylandsink: access sink->pool in a more atomic fashion
Diffstat (limited to 'ext/wayland')
-rw-r--r--ext/wayland/gstwaylandsink.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
index 8b2d527ea..a1035b2d0 100644
--- a/ext/wayland/gstwaylandsink.c
+++ b/ext/wayland/gstwaylandsink.c
@@ -212,7 +212,7 @@ static gboolean
gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
{
GstWaylandSink *sink;
- GstBufferPool *newpool, *oldpool;
+ GstBufferPool *newpool;
GstVideoInfo info;
GstStructure *structure;
static GstAllocationParams params = { 0, 0, 0, 15, };
@@ -252,10 +252,8 @@ gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
if (!gst_buffer_pool_set_config (newpool, structure))
goto config_failed;
- oldpool = sink->pool;
- sink->pool = newpool;
- if (oldpool)
- gst_object_unref (oldpool);
+ gst_object_replace ((GstObject **) & sink->pool, (GstObject *) newpool);
+ gst_object_unref (newpool);
return TRUE;
@@ -298,7 +296,7 @@ static gboolean
gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
{
GstWaylandSink *sink = GST_WAYLAND_SINK (bsink);
- GstBufferPool *pool;
+ GstBufferPool *pool = NULL;
GstStructure *config;
GstCaps *caps;
guint size;
@@ -309,8 +307,8 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (caps == NULL)
goto no_caps;
- if ((pool = sink->pool))
- gst_object_ref (pool);
+ if (sink->pool)
+ pool = gst_object_ref (sink->pool);
if (pool != NULL) {
GstCaps *pcaps;