diff --git a/ChangeLog b/ChangeLog index 9575b7c776..ad2a7d1dfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-31 Michael Smith + + * plugins/elements/gsttypefindelement.c: + (gst_type_find_element_chain): + Do not typefind content if the buffers already have caps. + Neccesary for icydemux (#333657), and the right thing to do anyway. + 2006-03-30 Wim Taymans * libs/gst/base/gstbasesink.c: (gst_base_sink_init), diff --git a/common b/common index 45cc64e522..c18b429f2a 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 45cc64e522d61410eb8d1a3e7ef67569851cd77a +Subproject commit c18b429f2a3698b6fc5e849a637aa0c8b91e82b9 diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 600dea59d1..809a79aef9 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -534,6 +534,30 @@ gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer) typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad)); + /* Shortcircuit typefinding if we already have non-any caps */ + if (typefind->mode == MODE_TYPEFIND) { + GstCaps *caps = gst_buffer_get_caps (buffer); + + if (caps) { + if (gst_caps_is_any (caps)) { + gst_caps_unref (caps); + } else { + typefind->mode = MODE_NORMAL; + g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, + GST_TYPE_FIND_MAXIMUM, caps); + + if (typefind->store) { + GST_DEBUG_OBJECT (typefind, "Pushing store: %d", + GST_BUFFER_SIZE (typefind->store)); + gst_type_find_element_send_cached_events (typefind); + gst_buffer_set_caps (typefind->store, typefind->caps); + gst_pad_push (typefind->src, typefind->store); + typefind->store = NULL; + } + } + } + } + switch (typefind->mode) { case MODE_ERROR: /* we should already have called GST_ELEMENT_ERROR */