gl: avoid adding a NULL pool to propose allocation
authorMatthew Waters <ystreet00@gmail.com>
Wed, 2 Apr 2014 11:42:50 +0000 (22:42 +1100)
committerMatthew Waters <ystreet00@gmail.com>
Wed, 2 Apr 2014 11:42:50 +0000 (22:42 +1100)
ext/gl/gstglimagesink.c
gst-libs/gst/gl/gstglfilter.c
gst-libs/gst/gl/gstglmixer.c

index 6db9cfa..04c2502 100644 (file)
@@ -921,12 +921,14 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
       goto config_failed;
   }
   /* we need at least 2 buffer because we hold on to the last one */
-  gst_query_add_allocation_pool (query, pool, size, 2, 0);
+  if (pool) {
+    gst_query_add_allocation_pool (query, pool, size, 2, 0);
+    gst_object_unref (pool);
+  }
 
   /* we also support various metadata */
   gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
 
-  gst_object_unref (pool);
 
   gl_apis =
       gst_gl_api_to_string (gst_gl_context_get_gl_api (glimage_sink->context));
index 1358e00..41339f1 100644 (file)
@@ -806,8 +806,10 @@ gst_gl_filter_propose_allocation (GstBaseTransform * trans,
       goto config_failed;
   }
   /* we need at least 2 buffer because we hold on to the last one */
-  gst_query_add_allocation_pool (query, pool, size, 1, 0);
-  gst_object_unref (pool);
+  if (pool) {
+    gst_query_add_allocation_pool (query, pool, size, 1, 0);
+    gst_object_unref (pool);
+  }
 
   /* we also support various metadata */
   gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
index e4714b7..41db067 100644 (file)
@@ -321,7 +321,7 @@ gst_gl_mixer_propose_allocation (GstGLMixer * mix,
   GstBufferPool *pool;
   GstStructure *config;
   GstCaps *caps;
-  guint size;
+  guint size = 0;
   gboolean need_pool;
   GError *error = NULL;
   GstStructure *gl_context;
@@ -381,8 +381,11 @@ gst_gl_mixer_propose_allocation (GstGLMixer * mix,
     if (!gst_buffer_pool_set_config (pool, config))
       goto config_failed;
   }
-  gst_query_add_allocation_pool (query, pool, size, 1, 0);
-  gst_object_unref (pool);
+
+  if (pool) {
+    gst_query_add_allocation_pool (query, pool, size, 1, 0);
+    gst_object_unref (pool);
+  }
 
   /* we also support various metadata */
   gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
@@ -1614,7 +1617,7 @@ gst_gl_mixer_process_textures (GstGLMixer * mix, GstBuffer * outbuf)
   guint out_tex;
   guint array_index = 0;
   guint i;
-  gboolean res;
+  gboolean res = TRUE;
 
   GST_TRACE ("Processing buffers");