This fixes a critical warning if the last-sample property is enabled:
(gst-launch-1.0:391): GStreamer-CRITICAL **: 01:12:57.428: gst_object_unref: assertion 'object != NULL' failed
If the allocation query does not contain any allocation pools,
gst_query_parse_nth_allocation_pool will leave the local pool,
min, and max variables undefined, so check the array length first.
If pool is NULL, do not call gst_object_unref.
g_object_get (bsink, "enable-last-sample", &last_sample_enabled, NULL);
- if (last_sample_enabled) {
+ if (last_sample_enabled && gst_query_get_n_allocation_pools (query) > 0) {
GstBufferPool *pool;
guint size, min, max;
max = min;
gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max);
- gst_object_unref (pool);
+ if (pool)
+ gst_object_unref (pool);
}
return TRUE;