volatile gboolean segment;
volatile gboolean eos;
volatile gboolean expect_flush;
+ volatile gboolean saw_serialized_event;
+ volatile gboolean saw_stream_start;
GstObject *parent;
GList *pads;
};
} else if (GST_IS_EVENT (data)) {
GstEvent *event = (GstEvent *) data;
- GST_DEBUG_OBJECT (pad, "%s", GST_EVENT_TYPE_NAME (event));
+ GST_DEBUG_OBJECT (pad, "Event : %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
/* getting two flush_start in a row seems to be okay
consist->flushing = consist->expect_flush = FALSE;
break;
case GST_EVENT_STREAM_START:
+ fail_if (consist->saw_serialized_event && !consist->saw_stream_start,
+ "Got a STREAM_START event after a serialized event");
+ consist->saw_stream_start = TRUE;
+ break;
case GST_EVENT_STREAM_CONFIG:
case GST_EVENT_CAPS:
/* ok to have these before segment event */
/* FIXME : Figure out what to do for other events */
break;
}
+ if (GST_EVENT_IS_SERIALIZED (event)) {
+ fail_if (!consist->saw_stream_start
+ && GST_EVENT_TYPE (event) != GST_EVENT_STREAM_START,
+ "Got a serialized event before a STREAM_START");
+ consist->saw_serialized_event = TRUE;
+ }
}
return TRUE;
void
gst_consistency_checker_reset (GstStreamConsistency * consist)
{
- consist->eos = FALSE;
consist->flushing = FALSE;
consist->segment = FALSE;
+ consist->eos = FALSE;
+ consist->expect_flush = FALSE;
+ consist->saw_serialized_event = FALSE;
+ consist->saw_stream_start = FALSE;
}
/**