+2006-08-31 Edward Hervey <edward@fluendo.com>
+
+ * ext/ogg/gstoggdemux.c: (gst_ogg_demux_init),
+ (gst_ogg_demux_finalize), (gst_ogg_demux_perform_seek),
+ (gst_ogg_demux_loop):
+ Send the GST_EVENT_NEW_SEGMENT from the streaming thread.
+
2006-08-30 Tim-Philipp Müller <tim at centricular dot net>
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
gboolean segment_running;
GstEvent *event;
+ GstEvent *newsegment; /* pending newsegment to be sent from _loop */
gint64 current_granule;
ogg->chain_lock = g_mutex_new ();
ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *));
+ ogg->newsegment = NULL;
}
static void
g_mutex_free (ogg->chain_lock);
ogg_sync_clear (&ogg->sync);
+ if (ogg->newsegment)
+ gst_event_unref (ogg->newsegment);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
} else {
/* mark discont and send segment on current chain */
gst_ogg_chain_mark_discont (chain);
- gst_ogg_demux_send_event (ogg, event);
+ /* This event should be sent from the streaming thread (sink pad task) */
+ if (ogg->newsegment)
+ gst_event_unref (ogg->newsegment);
+ ogg->newsegment = event;
}
/* notify start of new segment */
ogg->offset += GST_BUFFER_SIZE (buffer);
+ if (G_UNLIKELY (ogg->newsegment)) {
+ gst_ogg_demux_send_event (ogg, ogg->newsegment);
+ ogg->newsegment = NULL;
+ }
+
ret = gst_ogg_demux_chain (ogg->sinkpad, buffer);
if (ret != GST_FLOW_OK) {
GST_LOG_OBJECT (ogg, "Failed demux_chain");