omxvideodec: consolidate the decision to try UseBuffer

The tee element can call gst_query_add_allocation_pool with pool as NULL.
Checking nth > 0 is not enough so we need to verify if there is a pool.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
https://bugzilla.gnome.org/show_bug.cgi?id=784069
This commit is contained in:
Julien Isorce 2017-12-13 12:06:40 +00:00
parent 0d2d695eff
commit 6600a520a5

View file

@ -2787,7 +2787,7 @@ gst_omx_video_dec_finish (GstVideoDecoder * decoder)
static gboolean
gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
{
GstBufferPool *pool;
GstBufferPool *pool = NULL;
GstStructure *config;
GstOMXVideoDec *self = GST_OMX_VIDEO_DEC (bdec);
@ -2837,8 +2837,13 @@ gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
self->use_buffers = FALSE;
if (gst_query_get_n_allocation_pools (query) > 0) {
GST_DEBUG_OBJECT (self, "Try using downstream buffers with OMX_UseBuffer");
self->use_buffers = TRUE;
gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
if (pool) {
GST_DEBUG_OBJECT (self,
"Try using downstream buffers with OMX_UseBuffer");
self->use_buffers = TRUE;
gst_object_unref (pool);
}
}
if (!GST_VIDEO_DECODER_CLASS