x11: handle case where no bufferpool is suggested

This commit is contained in:
Wim Taymans 2012-06-15 16:43:47 +02:00
parent 1e635f682f
commit f3fdfd9ec8
2 changed files with 10 additions and 8 deletions

View file

@ -1473,15 +1473,16 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (!gst_buffer_pool_set_config (pool, config))
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) {
/* we need at least 2 buffer because we hold on to the last one */
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);
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE);
gst_object_unref (pool);
return TRUE;
/* ERRORS */

View file

@ -1984,15 +1984,16 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
if (!gst_buffer_pool_set_config (pool, config))
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) {
/* we need at least 2 buffer because we hold on to the last one */
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);
gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE);
gst_object_unref (pool);
return TRUE;
/* ERRORS */