From 5554f286bda16f24c6d84f3cdb658a162fe70ddc Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 4 Feb 2004 22:16:30 +0000 Subject: [PATCH] gst/autoplug/gstspideridentity.c: use get_allowed_caps, not get_caps (fixes #132519) Original commit message from CVS: 2004-02-04 Benjamin Otte * gst/autoplug/gstspideridentity.c: (gst_spider_identity_sink_loop_type_finding): use get_allowed_caps, not get_caps (fixes #132519) * gst/elements/gsttypefind.c: (stop_typefinding): use correct order when sending buffers and seeking --- ChangeLog | 8 ++++++++ gst/autoplug/gstspideridentity.c | 4 ++-- gst/elements/gsttypefind.c | 11 ++++++----- plugins/elements/gsttypefind.c | 11 ++++++----- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c1fd4e7e3..90efcb83c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-02-04 Benjamin Otte + + * gst/autoplug/gstspideridentity.c: + (gst_spider_identity_sink_loop_type_finding): + use get_allowed_caps, not get_caps (fixes #132519) + * gst/elements/gsttypefind.c: (stop_typefinding): + use correct order when sending buffers and seeking + 2004-02-04 Thomas Vander Stichele * configure.ac: diff --git a/gst/autoplug/gstspideridentity.c b/gst/autoplug/gstspideridentity.c index 827c9a24bb..598eb76a2f 100644 --- a/gst/autoplug/gstspideridentity.c +++ b/gst/autoplug/gstspideridentity.c @@ -471,8 +471,8 @@ gst_spider_identity_sink_loop_type_finding (GstSpiderIdentity *ident) find.buffer = GST_BUFFER (data); /* maybe there are already valid caps now? */ - find.caps = gst_pad_get_caps (ident->sink); - if (! gst_caps_is_empty (find.caps) && !gst_caps_is_any (find.caps)) { + find.caps = gst_pad_get_allowed_caps (ident->sink); + if (!gst_caps_is_empty (find.caps) && !gst_caps_is_any (find.caps)) { goto plug; } else { gst_caps_free (find.caps); diff --git a/gst/elements/gsttypefind.c b/gst/elements/gsttypefind.c index 1ffdfbce4e..47a03853d9 100644 --- a/gst/elements/gsttypefind.c +++ b/gst/elements/gsttypefind.c @@ -336,16 +336,17 @@ stop_typefinding (GstTypeFindElement *typefind) GstBuffer *buffer; guint size = gst_buffer_store_get_size (typefind->store, 0); + if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) { + GST_LOG_OBJECT (typefind, "pushing cached data (%u bytes)", size); + gst_pad_push (typefind->src, GST_DATA (buffer)); + } else { + size = 0; + } GST_LOG_OBJECT (typefind, "seeking back to current position %u", size); if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink), gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) { GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size); } - if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) { - gst_pad_push (typefind->src, GST_DATA (buffer)); - } else { - size = 0; - } } gst_buffer_store_clear (typefind->store); } diff --git a/plugins/elements/gsttypefind.c b/plugins/elements/gsttypefind.c index 1ffdfbce4e..47a03853d9 100644 --- a/plugins/elements/gsttypefind.c +++ b/plugins/elements/gsttypefind.c @@ -336,16 +336,17 @@ stop_typefinding (GstTypeFindElement *typefind) GstBuffer *buffer; guint size = gst_buffer_store_get_size (typefind->store, 0); + if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) { + GST_LOG_OBJECT (typefind, "pushing cached data (%u bytes)", size); + gst_pad_push (typefind->src, GST_DATA (buffer)); + } else { + size = 0; + } GST_LOG_OBJECT (typefind, "seeking back to current position %u", size); if (!gst_pad_send_event (GST_PAD_PEER (typefind->sink), gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, size))) { GST_WARNING_OBJECT (typefind, "could not seek to required position %u, hope for the best", size); } - if (size && (buffer = gst_buffer_store_get_buffer (typefind->store, 0, size))) { - gst_pad_push (typefind->src, GST_DATA (buffer)); - } else { - size = 0; - } } gst_buffer_store_clear (typefind->store); }