From: Sebastian Dröge Date: Tue, 13 May 2008 12:38:31 +0000 (+0000) Subject: plugins/elements/gsttypefindelement.c: Clean up on FLUSH_STOP and not FLUSH_START... X-Git-Tag: RELEASE-0_10_20~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2422145dae51fced61bb2bb8ae02e7f290e59f7;p=platform%2Fupstream%2Fgstreamer.git plugins/elements/gsttypefindelement.c: Clean up on FLUSH_STOP and not FLUSH_START. Forward both events immediately. Original commit message from CVS: * plugins/elements/gsttypefindelement.c: (gst_type_find_element_handle_event), (gst_type_find_element_send_cached_events), (gst_type_find_element_change_state): Clean up on FLUSH_STOP and not FLUSH_START. Forward both events immediately. --- diff --git a/ChangeLog b/ChangeLog index 110bb1c..207ff83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ 2008-05-13 Sebastian Dröge * plugins/elements/gsttypefindelement.c: + (gst_type_find_element_handle_event), + (gst_type_find_element_send_cached_events), + (gst_type_find_element_change_state): + Clean up on FLUSH_STOP and not FLUSH_START. Forward both events + immediately. + +2008-05-13 Sebastian Dröge + + * plugins/elements/gsttypefindelement.c: (gst_type_find_handle_src_query), (stop_typefinding), (gst_type_find_element_handle_event), (gst_type_find_element_send_cached_events), diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index d2e74e9..8b801ae 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -517,23 +517,21 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) res = gst_pad_event_default (pad, event); break; } - case GST_EVENT_FLUSH_START: - GST_OBJECT_LOCK (typefind); + case GST_EVENT_FLUSH_STOP: g_list_foreach (typefind->cached_events, (GFunc) gst_mini_object_unref, NULL); g_list_free (typefind->cached_events); typefind->cached_events = NULL; - GST_OBJECT_UNLOCK (typefind); gst_buffer_replace (&typefind->store, NULL); + /* fall through */ + case GST_EVENT_FLUSH_START: res = gst_pad_event_default (pad, event); break; default: GST_DEBUG_OBJECT (typefind, "Saving %s event to send later", GST_EVENT_TYPE_NAME (event)); - GST_OBJECT_LOCK (typefind); typefind->cached_events = g_list_append (typefind->cached_events, event); - GST_OBJECT_UNLOCK (typefind); res = TRUE; break; } @@ -554,7 +552,6 @@ gst_type_find_element_send_cached_events (GstTypeFindElement * typefind) { GList *l; - GST_OBJECT_LOCK (typefind); for (l = typefind->cached_events; l != NULL; l = l->next) { GstEvent *event = GST_EVENT (l->data); @@ -564,7 +561,6 @@ gst_type_find_element_send_cached_events (GstTypeFindElement * typefind) } g_list_free (typefind->cached_events); typefind->cached_events = NULL; - GST_OBJECT_UNLOCK (typefind); } static gboolean @@ -839,12 +835,10 @@ gst_type_find_element_change_state (GstElement * element, case GST_STATE_CHANGE_READY_TO_NULL: gst_caps_replace (&typefind->caps, NULL); - GST_OBJECT_LOCK (typefind); g_list_foreach (typefind->cached_events, (GFunc) gst_mini_object_unref, NULL); g_list_free (typefind->cached_events); typefind->cached_events = NULL; - GST_OBJECT_UNLOCK (typefind); break; default: break;