2008-05-13 Sebastian Dröge <slomo@circular-chaos.org>
+ * 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),
+ (gst_type_find_element_change_state):
+ Forward FLUSH_START events immediately and clean up instead of
+ caching them.
+
+2008-05-13 Sebastian Dröge <slomo@circular-chaos.org>
+
Patch by: Sjoerd Simons <sjoerd at luon dot net>
* libs/gst/base/gstbasetransform.c:
/* FIXME: this code assumes that there's no discont in the queue */
switch (format) {
case GST_FORMAT_BYTES:
- peer_pos -= typefind->store->size;
+ peer_pos -= GST_BUFFER_SIZE (typefind->store);
break;
default:
/* FIXME */
res = gst_pad_event_default (pad, event);
break;
}
+ case GST_EVENT_FLUSH_START:
+ 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);
+ gst_buffer_replace (&typefind->store, NULL);
+ 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;
}
{
GList *l;
+ GST_OBJECT_LOCK (typefind);
for (l = typefind->cached_events; l != NULL; l = l->next) {
GstEvent *event = GST_EVENT (l->data);
}
g_list_free (typefind->cached_events);
typefind->cached_events = NULL;
+ GST_OBJECT_UNLOCK (typefind);
}
static gboolean
case GST_STATE_CHANGE_PAUSED_TO_READY:
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;