diff --git a/ChangeLog b/ChangeLog index 3060ac97fe..a6984a4ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-16 Wim Taymans + + * gst/base/gstbasetransform.c: + (gst_base_transform_prepare_output_buf), + (gst_base_transform_event): + Check if the caps are NULL, this can happen if the element + is shutting down and the pad caps are set to NULL. + 2005-11-16 Thomas Vander Stichele * gst/elements/gsttee.c: (gst_tee_init): diff --git a/gst/base/gstbasetransform.c b/gst/base/gstbasetransform.c index 12d2323e72..b3889c3b2e 100644 --- a/gst/base/gstbasetransform.c +++ b/gst/base/gstbasetransform.c @@ -812,7 +812,8 @@ gst_base_transform_prepare_output_buf (GstBaseTransform * trans, /* out_caps is the caps of the src pad gathered through the GST_PAD_CAPS macro. If a set_caps occurs during this function this caps will become invalid. We want to keep them during preparation of the output buffer. */ - gst_caps_ref (out_caps); + if (out_caps) + gst_caps_ref (out_caps); /* see if the subclass wants to alloc a buffer */ if (bclass->prepare_output_buffer) { @@ -873,7 +874,8 @@ gst_base_transform_prepare_output_buf (GstBaseTransform * trans, } done: - gst_caps_unref (out_caps); + if (out_caps) + gst_caps_unref (out_caps); trans->delay_configure = FALSE; return ret; diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 12d2323e72..b3889c3b2e 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -812,7 +812,8 @@ gst_base_transform_prepare_output_buf (GstBaseTransform * trans, /* out_caps is the caps of the src pad gathered through the GST_PAD_CAPS macro. If a set_caps occurs during this function this caps will become invalid. We want to keep them during preparation of the output buffer. */ - gst_caps_ref (out_caps); + if (out_caps) + gst_caps_ref (out_caps); /* see if the subclass wants to alloc a buffer */ if (bclass->prepare_output_buffer) { @@ -873,7 +874,8 @@ gst_base_transform_prepare_output_buf (GstBaseTransform * trans, } done: - gst_caps_unref (out_caps); + if (out_caps) + gst_caps_unref (out_caps); trans->delay_configure = FALSE; return ret;