From d2e942ac02d770e1d0cc96cc6d95c85648b4efd9 Mon Sep 17 00:00:00 2001 From: Song Bing Date: Wed, 17 Jun 2015 18:03:09 +0800 Subject: [PATCH] streamsynchronizer: Unblock EOS wait when track switching. sink_event () will blocked on EOS event. which will cause can't send event when switch EOS track to non-EOS one. https://bugzilla.gnome.org/show_bug.cgi?id=750761 --- gst/playback/gststreamsynchronizer.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index d417670376..b55e328a9c 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -512,6 +512,25 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent, self->group_start_time = new_group_start_time; GST_STREAM_SYNCHRONIZER_UNLOCK (self); break; + } + /* unblocking EOS wait when track switch. */ + case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:{ + if (gst_event_has_name (event, "playsink-custom-video-flush") + || gst_event_has_name (event, "playsink-custom-audio-flush") + || gst_event_has_name (event, "playsink-custom-subtitle-flush")) { + GstStream *stream; + + GST_STREAM_SYNCHRONIZER_LOCK (self); + stream = gst_pad_get_element_private (pad); + if (stream) { + stream->is_eos = FALSE; + stream->eos_sent = FALSE; + stream->wait = FALSE; + g_cond_broadcast (&stream->stream_finish_cond); + } + GST_STREAM_SYNCHRONIZER_UNLOCK (self); + } + break; } case GST_EVENT_EOS:{ GstStream *stream;