mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
x(v)imagesink: If NULL caps are passed to buffer_alloc() do fallback allocation
Fixes bug #647857.
This commit is contained in:
parent
37b3878047
commit
75c337c726
2 changed files with 17 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue