From: Benjamin Otte Date: Sun, 7 Dec 2003 19:02:30 +0000 (+0000) Subject: finish everything typefinding related (like seeking to correct offset) _before_ pushi... X-Git-Tag: CAPS-MERGE-3~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d7ea92eda8368795dee55990f990695c4f5464;p=platform%2Fupstream%2Fgstreamer.git finish everything typefinding related (like seeking to correct offset) _before_ pushing the first buffer Original commit message from CVS: finish everything typefinding related (like seeking to correct offset) _before_ pushing the first buffer --- diff --git a/gst/elements/gsttypefind.c b/gst/elements/gsttypefind.c index 7d38b0f..97f0626 100644 --- a/gst/elements/gsttypefind.c +++ b/gst/elements/gsttypefind.c @@ -366,16 +366,17 @@ stop_typefinding (GstTypeFindElement *typefind) if (push_cached_buffers) { 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_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/gst/elements/gsttypefindelement.c b/gst/elements/gsttypefindelement.c index 7d38b0f..97f0626 100644 --- a/gst/elements/gsttypefindelement.c +++ b/gst/elements/gsttypefindelement.c @@ -366,16 +366,17 @@ stop_typefinding (GstTypeFindElement *typefind) if (push_cached_buffers) { 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_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 7d38b0f..97f0626 100644 --- a/plugins/elements/gsttypefind.c +++ b/plugins/elements/gsttypefind.c @@ -366,16 +366,17 @@ stop_typefinding (GstTypeFindElement *typefind) if (push_cached_buffers) { 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_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/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 7d38b0f..97f0626 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -366,16 +366,17 @@ stop_typefinding (GstTypeFindElement *typefind) if (push_cached_buffers) { 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_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); }