valve: Don't read sticky flag from unrefed event

This commit is contained in:
Nicolas Dufresne 2013-05-25 22:03:53 -04:00
parent 789b68e506
commit 5bbc6f1c8c

View file

@ -223,12 +223,13 @@ static gboolean
gst_valve_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_valve_event (GstPad * pad, GstObject * parent, GstEvent * event)
{ {
GstValve *valve; GstValve *valve;
gboolean is_sticky = GST_EVENT_IS_STICKY (event);
gboolean ret = TRUE; gboolean ret = TRUE;
valve = GST_VALVE (parent); valve = GST_VALVE (parent);
if (g_atomic_int_get (&valve->drop)) { if (g_atomic_int_get (&valve->drop)) {
valve->need_repush_sticky |= GST_EVENT_IS_STICKY (event); valve->need_repush_sticky |= is_sticky;
gst_event_unref (event); gst_event_unref (event);
} else { } else {
if (valve->need_repush_sticky) if (valve->need_repush_sticky)
@ -240,7 +241,7 @@ gst_valve_event (GstPad * pad, GstObject * parent, GstEvent * event)
* downwards. * downwards.
*/ */
if (g_atomic_int_get (&valve->drop)) { if (g_atomic_int_get (&valve->drop)) {
valve->need_repush_sticky |= GST_EVENT_IS_STICKY (event); valve->need_repush_sticky |= is_sticky;
ret = TRUE; ret = TRUE;
} }