Don't send event on unusable pads.

Original commit message from CVS:
Don't send event on unusable pads.
This commit is contained in:
Wim Taymans 2002-08-02 11:29:59 +00:00
parent 827ee90f76
commit 5ac10a9303

View file

@ -294,7 +294,6 @@ gst_mad_class_init (GstMadClass *klass)
g_object_class_install_property (gobject_class, ARG_CHANNELS, g_object_class_install_property (gobject_class, ARG_CHANNELS,
g_param_spec_enum ("channels", "Channels", "number of channels", g_param_spec_enum ("channels", "Channels", "number of channels",
GST_TYPE_MAD_CHANNELS, 0, G_PARAM_READABLE)); GST_TYPE_MAD_CHANNELS, 0, G_PARAM_READABLE));
} }
static void static void
@ -794,6 +793,9 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer)
gint n = GST_EVENT_DISCONT_OFFSET_LEN (event); gint n = GST_EVENT_DISCONT_OFFSET_LEN (event);
gint i; gint i;
if (!GST_PAD_IS_USABLE (mad->srcpad))
return;
for (i=0; i<n; i++) { for (i=0; i<n; i++) {
if (gst_pad_handles_format (pad, GST_EVENT_DISCONT_OFFSET(event,i).format)) if (gst_pad_handles_format (pad, GST_EVENT_DISCONT_OFFSET(event,i).format))
{ {