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.
This commit is contained in:
Edward Hervey 2006-08-31 12:31:00 +00:00
parent 573d041ca7
commit 208d02b5e4
2 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,10 @@
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:

View file

@ -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");