typefind: Send stream-start before anything else

To do so, send stream-start when the streaming thread goes up for the first
time.

https://bugzilla.gnome.org/show_bug.cgi?id=699767
This commit is contained in:
Nicolas Dufresne 2013-05-06 18:47:44 -04:00 committed by Sebastian Dröge
parent 9f5e9c8632
commit ba354f6b03

View file

@ -979,6 +979,19 @@ gst_type_find_element_loop (GstPad * pad)
typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad)); typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
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->mode == MODE_TYPEFIND) { if (typefind->mode == MODE_TYPEFIND) {
GstPad *peer; GstPad *peer;
GstCaps *found_caps = NULL; GstCaps *found_caps = NULL;
@ -1044,21 +1057,6 @@ gst_type_find_element_loop (GstPad * pad)
} else if (typefind->mode == MODE_NORMAL) { } else if (typefind->mode == MODE_NORMAL) {
GstBuffer *outbuf = NULL; 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) { if (typefind->need_segment) {
typefind->need_segment = FALSE; typefind->need_segment = FALSE;
gst_pad_push_event (typefind->src, gst_pad_push_event (typefind->src,