Skip to content
Snippets Groups Projects
Commit 9f3d06c4 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller :tropical_fish:
Browse files

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
parent f3293d37
No related branches found
No related tags found
Loading
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment