videomixer: Do not send flush_stop ourself after a flush_start

When we receive a flush_start, we should wait for the next flush_stop
and foward it, not create a flush_stop ourself.
This commit is contained in:
Thibault Saunier 2013-08-17 11:28:13 +02:00
parent db90f6e68d
commit e47ffb203b
2 changed files with 8 additions and 3 deletions

View file

@ -644,6 +644,7 @@ gst_videomixer2_reset (GstVideoMixer2 * mix)
mix->newseg_pending = TRUE; mix->newseg_pending = TRUE;
g_atomic_int_set (&mix->flush_stop_pending, FALSE); g_atomic_int_set (&mix->flush_stop_pending, FALSE);
g_atomic_int_set (&mix->waiting_flush_stop, FALSE);
} }
/* 1 == OK /* 1 == OK
@ -1734,13 +1735,13 @@ gst_videomixer2_sink_event (GstCollectPads * pads, GstCollectData * cdata,
break; break;
} }
case GST_EVENT_FLUSH_START: case GST_EVENT_FLUSH_START:
g_atomic_int_set (&mix->flush_stop_pending, TRUE); g_atomic_int_set (&mix->waiting_flush_stop, TRUE);
ret = gst_collect_pads_event_default (pads, cdata, event, discard); ret = gst_collect_pads_event_default (pads, cdata, event, discard);
event = NULL; event = NULL;
break; break;
case GST_EVENT_FLUSH_STOP: case GST_EVENT_FLUSH_STOP:
mix->newseg_pending = TRUE; mix->newseg_pending = TRUE;
if (g_atomic_int_compare_and_exchange (&mix->flush_stop_pending, TRUE, if (g_atomic_int_compare_and_exchange (&mix->waiting_flush_stop, TRUE,
FALSE)) { FALSE)) {
GST_DEBUG_OBJECT (pad, "forwarding flush stop"); GST_DEBUG_OBJECT (pad, "forwarding flush stop");
ret = gst_collect_pads_event_default (pads, cdata, event, discard); ret = gst_collect_pads_event_default (pads, cdata, event, discard);

View file

@ -97,7 +97,11 @@ struct _GstVideoMixer2
gboolean send_caps; gboolean send_caps;
gboolean newseg_pending; gboolean newseg_pending;
gboolean flush_stop_pending; gboolean flush_stop_pending; /* Used when we receive a flushing seek,
to send a flush_stop right before the
following buffer */
gboolean waiting_flush_stop; /* Used when we receive a flush_start to make
sure to forward the flush_stop only once */
GstVideoMixer2Background background; GstVideoMixer2Background background;