From: Wim Taymans Date: Wed, 26 Sep 2012 11:19:13 +0000 (+0200) Subject: typefind: send STREAM-START event X-Git-Tag: 1.0.1~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=701424be9b18e5c06b87ead144ab540fc7020e01;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 33e2376..f9a16f5 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -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 { diff --git a/plugins/elements/gsttypefindelement.h b/plugins/elements/gsttypefindelement.h index 2ee3325..66607db 100644 --- a/plugins/elements/gsttypefindelement.h +++ b/plugins/elements/gsttypefindelement.h @@ -61,6 +61,7 @@ struct _GstTypeFindElement { /* Only used when driving the pipeline */ gboolean need_segment; + gboolean need_stream_start; GstSegment segment; guint64 offset; };