summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-12-21 00:40:10 +1100
committerJan Schmidt <jan@centricular.com>2017-02-27 23:50:41 +1100
commite68c071bf01c1b4b796c48a87b511005e8c0c9f6 (patch)
treeff3fd63234c9bf5fdaecb0efbe3a769f7d19c852
parentf727d67d5300b85fae405d371dd171b6528eb9ed (diff)
downloadgstreamer-e68c071bf01c1b4b796c48a87b511005e8c0c9f6.tar.gz
typefind: Switch to normal mode before have-type
Before emitting have-type, switch to NORMAL mode, as part of the have-type processing sends the caps event downstream, which might trigger actions like downstream autoplugging or flushing seeks - and the latter are only passed upstream if we've set typefind to NORMAL mode.
-rw-r--r--plugins/elements/gsttypefindelement.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c
index a63dca7b47..5936d580cb 100644
--- a/plugins/elements/gsttypefindelement.c
+++ b/plugins/elements/gsttypefindelement.c
@@ -558,6 +558,7 @@ gst_type_find_element_src_event (GstPad * pad, GstObject * parent,
if (typefind->mode != MODE_NORMAL) {
/* need to do more? */
+ GST_LOG_OBJECT (typefind, "Still typefinding. Not passing event upstream");
gst_event_unref (event);
return FALSE;
}
@@ -783,6 +784,8 @@ gst_type_find_element_setcaps (GstTypeFindElement * typefind, GstCaps * caps)
if (gst_caps_is_any (caps))
return TRUE;
+ /* Set to MODE_NORMAL before emitting have-type, in case it triggers a seek */
+ typefind->mode = MODE_NORMAL;
gst_type_find_element_emit_have_type (typefind, GST_TYPE_FIND_MAXIMUM, caps);
/* Shortcircuit typefinding if we get caps */
@@ -967,6 +970,8 @@ gst_type_find_element_chain_do_typefinding (GstTypeFindElement * typefind,
/* probability is good enough too, so let's make it known ... emiting this
* signal calls our object handler which sets the caps. */
+ /* Set to MODE_NORMAL before emitting have-type, in case it triggers a seek */
+ typefind->mode = MODE_NORMAL;
gst_type_find_element_emit_have_type (typefind, probability, caps);
/* .. and send out the accumulated data */
@@ -1158,8 +1163,9 @@ gst_type_find_element_loop (GstPad * pad)
}
GST_DEBUG ("Emiting found caps %" GST_PTR_FORMAT, found_caps);
- gst_type_find_element_emit_have_type (typefind, probability, found_caps);
+ /* Set to MODE_NORMAL before emitting have-type, in case it triggers a seek */
typefind->mode = MODE_NORMAL;
+ gst_type_find_element_emit_have_type (typefind, probability, found_caps);
gst_caps_unref (found_caps);
} else if (typefind->mode == MODE_NORMAL) {
GstBuffer *outbuf = NULL;