diff --git a/ChangeLog b/ChangeLog index bddb5e3652..25287fff8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-10-08 Wim Taymans + + * gst/elements/gsttypefindelement.c: + (gst_type_find_element_handle_event): + Handle EOS events when doing the transition from + typefind to data passing. This should fix the + infinite loops in short files. + 2004-10-07 Wim Taymans * gst/gstthread.c: (gst_thread_change_state), diff --git a/gst/elements/gsttypefindelement.c b/gst/elements/gsttypefindelement.c index 52fb1be32b..daf33bac61 100644 --- a/gst/elements/gsttypefindelement.c +++ b/gst/elements/gsttypefindelement.c @@ -434,6 +434,9 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) TypeFindEntry *entry; GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad)); + GST_DEBUG_OBJECT (typefind, "got event %d in mode %d", GST_EVENT_TYPE (event), + typefind->mode); + switch (typefind->mode) { case MODE_TYPEFIND: switch (GST_EVENT_TYPE (event)) { @@ -478,6 +481,9 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) gst_event_unref (event); } } + } else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { + push_buffer_store (typefind); + gst_pad_event_default (pad, event); } else { gst_event_unref (event); } diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 52fb1be32b..daf33bac61 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -434,6 +434,9 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) TypeFindEntry *entry; GstTypeFindElement *typefind = GST_TYPE_FIND_ELEMENT (GST_PAD_PARENT (pad)); + GST_DEBUG_OBJECT (typefind, "got event %d in mode %d", GST_EVENT_TYPE (event), + typefind->mode); + switch (typefind->mode) { case MODE_TYPEFIND: switch (GST_EVENT_TYPE (event)) { @@ -478,6 +481,9 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) gst_event_unref (event); } } + } else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { + push_buffer_store (typefind); + gst_pad_event_default (pad, event); } else { gst_event_unref (event); }