- GST_DEBUG_OBJECT (decode_bin, "trying to link %s",
- gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)));
+ GST_DEBUG_OBJECT (decode_bin, "trying to link %s to %s",
+ gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)),
+ GST_OBJECT_NAME (srcelement));
+
+ /* don't plug the same parser twice, but allow multiple
+ * instances of other elements (e.g. id3demux) in a row */
+ src_factory = gst_element_get_factory (srcelement);
+ if (src_factory == factory
+ && gst_element_factory_list_is_type (factory,
+ GST_ELEMENT_FACTORY_TYPE_PARSER)) {
+ GST_DEBUG_OBJECT (decode_bin,
+ "not inserting parser element %s twice in a row, skipping",
+ GST_PLUGIN_FEATURE_NAME (factory));
+ continue;
+ }