Only unset the scheduler on REAL pads. This is a nasty one that causes random memory corruption.

Original commit message from CVS:
Only unset the scheduler on REAL pads. This is a nasty one that causes
random memory corruption.
This commit is contained in:
Wim Taymans 2002-02-22 23:12:05 +00:00
parent 48c32ac434
commit 6bab7412ef

View file

@ -149,11 +149,13 @@ gst_scheduler_pad_disconnect (GstScheduler *sched, GstPad *srcpad, GstPad *sinkp
GstPad * GstPad *
gst_scheduler_pad_select (GstScheduler *sched, GList *padlist) gst_scheduler_pad_select (GstScheduler *sched, GList *padlist)
{ {
g_return_if_fail (GST_IS_SCHEDULER (sched)); g_return_val_if_fail (GST_IS_SCHEDULER (sched), NULL);
g_return_if_fail (padlist != NULL); g_return_val_if_fail (padlist != NULL, NULL);
if (CLASS (sched)->pad_select) if (CLASS (sched)->pad_select)
CLASS (sched)->pad_select (sched, padlist); CLASS (sched)->pad_select (sched, padlist);
return NULL;
} }
/** /**
@ -206,7 +208,7 @@ gst_scheduler_state_transition (GstScheduler *sched, GstElement *element, gint t
void void
gst_scheduler_remove_element (GstScheduler *sched, GstElement *element) gst_scheduler_remove_element (GstScheduler *sched, GstElement *element)
{ {
GList *l; GList *pads;
g_return_if_fail (GST_IS_SCHEDULER (sched)); g_return_if_fail (GST_IS_SCHEDULER (sched));
g_return_if_fail (GST_IS_ELEMENT (element)); g_return_if_fail (GST_IS_ELEMENT (element));
@ -214,8 +216,13 @@ gst_scheduler_remove_element (GstScheduler *sched, GstElement *element)
if (CLASS (sched)->remove_element) if (CLASS (sched)->remove_element)
CLASS (sched)->remove_element (sched, element); CLASS (sched)->remove_element (sched, element);
for (l=element->pads; l; l=l->next) for (pads = element->pads; pads; pads = pads->next) {
gst_pad_unset_sched ((GstPad*) l->data); GstPad *pad = GST_PAD (pads->data);
if (GST_IS_REAL_PAD (pad)) {
gst_pad_unset_sched (GST_PAD (pads->data));
}
}
} }
/** /**
@ -319,10 +326,12 @@ gst_scheduler_interrupt (GstScheduler *sched, GstElement *element)
gboolean gboolean
gst_scheduler_iterate (GstScheduler *sched) gst_scheduler_iterate (GstScheduler *sched)
{ {
g_return_if_fail (GST_IS_SCHEDULER (sched)); g_return_val_if_fail (GST_IS_SCHEDULER (sched), FALSE);
if (CLASS (sched)->iterate) if (CLASS (sched)->iterate)
CLASS (sched)->iterate (sched); return CLASS (sched)->iterate (sched);
return FALSE;
} }