pad: Check sinkpad for flushing

Check the sinkpad for the flushing state before calling the chainfunction on the
pad. We do this by checking the cache (which is also cleared on the srcpad when
the sink is set to flushing).

Fixes #641928
This commit is contained in:
Wim Taymans 2011-02-14 17:31:25 +01:00
parent 3aaef921c5
commit 12d2d01663

View file

@ -4658,6 +4658,8 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
peer = cache->peer;
GST_PAD_STREAM_LOCK (peer);
if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID))
goto invalid;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "calling chainfunction &%s",
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)));
@ -4697,6 +4699,12 @@ slow_path:
}
return ret;
}
invalid:
{
pad_free_cache (cache);
GST_PAD_STREAM_UNLOCK (peer);
goto slow_path;
}
}
/**
@ -4770,6 +4778,8 @@ gst_pad_push_list (GstPad * pad, GstBufferList * list)
peer = cache->peer;
GST_PAD_STREAM_LOCK (peer);
if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID))
goto invalid;
ret = GST_PAD_CHAINLISTFUNC (peer) (peer, list);
@ -4801,6 +4811,12 @@ slow_path:
}
return ret;
}
invalid:
{
pad_free_cache (cache);
GST_PAD_STREAM_UNLOCK (peer);
goto slow_path;
}
}
/**