+2006-04-28 Michael Smith <msmith@fluendo.com>
+
+ * gst/icydemux/gsticydemux.c: (gst_icydemux_reset),
+ (gst_icydemux_init), (gst_icydemux_sink_setcaps),
+ (gst_icydemux_add_srcpad), (gst_icydemux_parse_and_send_tags),
+ (gst_icydemux_handle_event), (gst_icydemux_send_cached_events),
+ (gst_icydemux_typefind_or_forward), (gst_icydemux_add_meta),
+ (gst_icydemux_chain), (gst_icydemux_send_tag_event):
+ * gst/icydemux/gsticydemux.h:
+ Fix event handling: cache events when typefinding and forward later.
+
+
2006-04-28 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/gstosxaudiosink.c:
static void gst_icydemux_dispose (GObject * object);
static GstFlowReturn gst_icydemux_chain (GstPad * pad, GstBuffer * buf);
+static gboolean gst_icydemux_handle_event (GstPad * pad, GstEvent * event);
static gboolean gst_icydemux_add_srcpad (GstICYDemux * icydemux,
GstCaps * new_caps);
icydemux->cached_tags = NULL;
}
+ if (icydemux->cached_events) {
+ g_list_foreach (icydemux->cached_events,
+ (GFunc) gst_mini_object_unref, NULL);
+ g_list_free (icydemux->cached_events);
+ icydemux->cached_events = NULL;
+ }
+
if (icydemux->meta_adapter) {
gst_adapter_clear (icydemux->meta_adapter);
g_object_unref (icydemux->meta_adapter);
"sink"), "sink");
gst_pad_set_chain_function (icydemux->sinkpad,
GST_DEBUG_FUNCPTR (gst_icydemux_chain));
+ gst_pad_set_event_function (icydemux->sinkpad,
+ GST_DEBUG_FUNCPTR (gst_icydemux_handle_event));
gst_pad_set_setcaps_function (icydemux->sinkpad,
GST_DEBUG_FUNCPTR (gst_icydemux_sink_setcaps));
gst_element_add_pad (GST_ELEMENT (icydemux), icydemux->sinkpad);
}
}
+static gboolean
+gst_icydemux_handle_event (GstPad * pad, GstEvent * event)
+{
+ GstICYDemux *icydemux = GST_ICYDEMUX (GST_PAD_PARENT (pad));
+
+ if (icydemux->typefinding) {
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_FLUSH_STOP:
+ g_list_foreach (icydemux->cached_events,
+ (GFunc) gst_mini_object_unref, NULL);
+ g_list_free (icydemux->cached_events);
+ icydemux->cached_events = NULL;
+
+ return gst_pad_event_default (pad, event);
+ default:
+ icydemux->cached_events = g_list_append (icydemux->cached_events,
+ event);
+ return TRUE;
+ }
+ } else {
+ return gst_pad_event_default (pad, event);
+ }
+}
+
+static void
+gst_icydemux_send_cached_events (GstICYDemux * icydemux)
+{
+ GList *l;
+
+ for (l = icydemux->cached_events; l != NULL; l = l->next) {
+ GstEvent *event = GST_EVENT (l->data);
+
+ gst_pad_push_event (icydemux->srcpad, event);
+ }
+ g_list_free (icydemux->cached_events);
+ icydemux->cached_events = NULL;
+}
+
static GstFlowReturn
gst_icydemux_typefind_or_forward (GstICYDemux * icydemux, GstBuffer * buf)
{
}
gst_caps_unref (caps);
+ if (icydemux->cached_events) {
+ gst_icydemux_send_cached_events (icydemux);
+ }
+
if (icydemux->cached_tags) {
gst_icydemux_send_tag_event (icydemux, icydemux->cached_tags);
icydemux->cached_tags = NULL;