mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 09:08:14 +00:00
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.
This commit is contained in:
parent
88c412bdc1
commit
f2422145da
2 changed files with 12 additions and 9 deletions
|
@ -1,3 +1,12 @@
|
|||
2008-05-13 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* 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 <slomo@circular-chaos.org>
|
||||
|
||||
* 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;
|
||||
|
|
Loading…
Reference in a new issue