Commit 208d02b5 authored by Edward Hervey's avatar Edward Hervey
Browse files

ext/ogg/gstoggdemux.c: Send the GST_EVENT_NEW_SEGMENT from the streaming thread.

Original commit message from CVS:
* 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.
parent 573d041c
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:
......
......@@ -182,6 +182,7 @@ struct _GstOggDemux
gboolean segment_running;
GstEvent *event;
GstEvent *newsegment; /* pending newsegment to be sent from _loop */
gint64 current_granule;
......@@ -1438,6 +1439,7 @@ gst_ogg_demux_init (GstOggDemux * ogg, GstOggDemuxClass * g_class)
ogg->chain_lock = g_mutex_new ();
ogg->chains = g_array_new (FALSE, TRUE, sizeof (GstOggChain *));
ogg->newsegment = NULL;
}
static void
......@@ -1451,6 +1453,9 @@ gst_ogg_demux_finalize (GObject * object)
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);
}
......@@ -2108,7 +2113,10 @@ gst_ogg_demux_perform_seek (GstOggDemux * ogg, GstEvent * event)
} 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 */
......@@ -2826,6 +2834,11 @@ gst_ogg_demux_loop (GstOggPad * pad)
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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment