+2005-12-14 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * gst/gstpad.c: (gst_pad_activate_pull), (gst_pad_link_prepare):
+ Don't allow activation of a srcpad in pull_range if it has no
+ getrange function.
+ Change some debug statements to be a little clearer
+
+ * plugins/elements/gsttypefindelement.c:
+ (gst_type_find_handle_src_query):
+ Check that we have a peer before executing queries thereupon.
+
+ * tests/examples/metadata/read-metadata.c: (message_loop):
+ Use gst_bus_pop instead of gst_bus_poll when we just want it to
+ immediately return us any available message with 0 timeout.
+
2005-12-12 Michael Smith <msmith@fluendo.com>
* gst/gsttypefindfactory.c: (gst_type_find_factory_call_function):
goto peer_failed;
gst_object_unref (peer);
}
+ } else {
+ if (GST_PAD_GETRANGEFUNC (pad) == NULL)
+ goto failure; /* Can't activate pull on a src without a
+ getrange function */
}
new = active ? GST_ACTIVATE_PULL : GST_ACTIVATE_NONE;
}
src_was_linked:
{
- GST_CAT_INFO (GST_CAT_PADS, "src %s:%s was linked",
+ GST_CAT_INFO (GST_CAT_PADS, "src %s:%s was already linked",
GST_DEBUG_PAD_NAME (srcpad));
/* we do not emit a warning in this case because unlinking cannot
* be made MT safe.*/
}
sink_was_linked:
{
- GST_CAT_INFO (GST_CAT_PADS, "sink %s:%s was linked",
+ GST_CAT_INFO (GST_CAT_PADS, "sink %s:%s was already linked",
GST_DEBUG_PAD_NAME (sinkpad));
/* we do not emit a warning in this case because unlinking cannot
* be made MT safe.*/
gst_type_find_handle_src_query (GstPad * pad, GstQuery * query)
{
GstTypeFindElement *typefind;
- gboolean res;
+ gboolean res = FALSE;
+ GstPad *peer;
typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad));
- res = gst_pad_query (GST_PAD_PEER (typefind->sink), query);
- if (!res)
+ peer = gst_pad_get_peer (typefind->sink);
+ if (peer == NULL)
return FALSE;
+ res = gst_pad_query (peer, query);
+ if (!res)
+ goto out;
+
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
GstFormat format;
if (typefind->store == NULL)
- return TRUE;
+ goto out;
gst_query_parse_position (query, &format, &peer_pos);
break;
}
- return TRUE;
+out:
+ gst_object_unref (peer);
+ return res;
}
#if 0
while (!done) {
GstMessage *message;
- message = gst_bus_poll (bus, GST_MESSAGE_ANY, 0);
+ message = gst_bus_pop (bus);
if (message == NULL)
/* All messages read, we're done */
break;