mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
basetransform: don't pass NULL outcaps to transform_size on shutdown
gst_pad_get_current_caps() on the source pad might yield NULL caps if we're being shut down and the source pad has already been deactivated by the other thread that's changing state. Just bail out in that case, instead of passing NULL caps to the transform_size function, which it might not expect. Fixes spurious warnings in audioresample shutdown unit test. https://bugzilla.gnome.org/show_bug.cgi?id=693996
This commit is contained in:
parent
15a3a5954f
commit
5a73d15c80
1 changed files with 10 additions and 1 deletions
|
@ -1574,6 +1574,10 @@ default_prepare_output_buffer (GstBaseTransform * trans,
|
|||
incaps = gst_pad_get_current_caps (trans->sinkpad);
|
||||
outcaps = gst_pad_get_current_caps (trans->srcpad);
|
||||
|
||||
/* srcpad might be flushing already if we're being shut down */
|
||||
if (outcaps == NULL)
|
||||
goto no_outcaps;
|
||||
|
||||
GST_DEBUG_OBJECT (trans, "getting output size for alloc");
|
||||
/* copy transform, figure out the output size */
|
||||
insize = gst_buffer_get_size (inbuf);
|
||||
|
@ -1602,7 +1606,6 @@ done:
|
|||
return GST_FLOW_OK;
|
||||
|
||||
/* ERRORS */
|
||||
/* ERRORS */
|
||||
activate_failed:
|
||||
{
|
||||
GST_ELEMENT_ERROR (trans, RESOURCE, SETTINGS,
|
||||
|
@ -1619,6 +1622,12 @@ alloc_failed:
|
|||
GST_DEBUG_OBJECT (trans, "could not allocate buffer from pool");
|
||||
return ret;
|
||||
}
|
||||
no_outcaps:
|
||||
{
|
||||
GST_DEBUG_OBJECT (trans, "no output caps, source pad has been deactivated");
|
||||
gst_caps_unref (incaps);
|
||||
return GST_FLOW_FLUSHING;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
|
Loading…
Reference in a new issue