typefind: send STREAM-START event

Send a STREAM_START event when we are operating in pull mode.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=684424
This commit is contained in:
Wim Taymans 2012-09-26 13:19:13 +02:00
parent cc41130664
commit 701424be9b
2 changed files with 17 additions and 0 deletions

View file

@ -1055,6 +1055,21 @@ gst_type_find_element_loop (GstPad * pad)
} else if (typefind->mode == MODE_NORMAL) {
GstBuffer *outbuf = NULL;
if (typefind->need_stream_start) {
gchar *stream_id;
stream_id =
gst_pad_create_stream_id (typefind->src, GST_ELEMENT_CAST (typefind),
NULL);
GST_DEBUG_OBJECT (typefind, "Pushing STREAM_START");
gst_pad_push_event (typefind->src,
gst_event_new_stream_start (stream_id));
typefind->need_stream_start = FALSE;
g_free (stream_id);
}
if (typefind->need_segment) {
typefind->need_segment = FALSE;
gst_pad_push_event (typefind->src,
@ -1136,6 +1151,7 @@ gst_type_find_element_activate_sink_mode (GstPad * pad, GstObject * parent,
if (active) {
gst_segment_init (&typefind->segment, GST_FORMAT_BYTES);
typefind->need_segment = TRUE;
typefind->need_stream_start = TRUE;
typefind->offset = 0;
res = TRUE;
} else {

View file

@ -61,6 +61,7 @@ struct _GstTypeFindElement {
/* Only used when driving the pipeline */
gboolean need_segment;
gboolean need_stream_start;
GstSegment segment;
guint64 offset;
};