x(v)imagesink: If NULL caps are passed to buffer_alloc() do fallback allocation

Fixes bug #647857.
This commit is contained in:
Sebastian Dröge 2011-04-18 11:24:57 +02:00
parent 37b3878047
commit 75c337c726
2 changed files with 17 additions and 0 deletions

View file

@ -1779,6 +1779,13 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
ximagesink = GST_XIMAGESINK (bsink);
if (G_UNLIKELY (!caps)) {
GST_WARNING_OBJECT (ximagesink, "have no caps, doing fallback allocation");
*buf = NULL;
ret = GST_FLOW_OK;
goto beach;
}
/* This shouldn't really happen because state changes will fail
* if the xcontext can't be allocated */
if (!ximagesink->xcontext)

View file

@ -2508,6 +2508,9 @@ gst_xvimagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
xvimagesink = GST_XVIMAGESINK (bsink);
if (G_UNLIKELY (!caps))
goto no_caps;
g_mutex_lock (xvimagesink->pool_lock);
if (G_UNLIKELY (xvimagesink->pool_invalid))
goto invalid;
@ -2701,6 +2704,13 @@ invalid_caps:
g_mutex_unlock (xvimagesink->pool_lock);
goto beach;
}
no_caps:
{
GST_WARNING_OBJECT (xvimagesink, "have no caps, doing fallback allocation");
*buf = NULL;
ret = GST_FLOW_OK;
goto beach;
}
}
/* Interfaces stuff */