mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
streamsplitter: Keep still meaningfull pending events on FLUSH_STOP
Only EOS and segment should be deleted in that case. https://bugzilla.gnome.org/show_bug.cgi?id=709868
This commit is contained in:
parent
967d1fb982
commit
42ecafec0c
1 changed files with 23 additions and 10 deletions
|
@ -149,6 +149,25 @@ nopad:
|
||||||
return GST_FLOW_ERROR;
|
return GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GList *
|
||||||
|
_flush_events (GstPad * pad, GList * events)
|
||||||
|
{
|
||||||
|
GList *tmp;
|
||||||
|
|
||||||
|
for (tmp = events; tmp; tmp = tmp->next) {
|
||||||
|
if (GST_EVENT_TYPE (tmp->data) == GST_EVENT_EOS ||
|
||||||
|
GST_EVENT_TYPE (tmp->data) == GST_EVENT_SEGMENT ||
|
||||||
|
!GST_EVENT_IS_STICKY (tmp->data) || pad == NULL) {
|
||||||
|
gst_event_unref (tmp->data);
|
||||||
|
} else {
|
||||||
|
gst_pad_store_sticky_event (pad, GST_EVENT_CAST (tmp->data));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_list_free (events);
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_stream_splitter_sink_event (GstPad * pad, GstObject * parent,
|
gst_stream_splitter_sink_event (GstPad * pad, GstObject * parent,
|
||||||
GstEvent * event)
|
GstEvent * event)
|
||||||
|
@ -157,8 +176,6 @@ gst_stream_splitter_sink_event (GstPad * pad, GstObject * parent,
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
gboolean toall = FALSE;
|
gboolean toall = FALSE;
|
||||||
gboolean store = FALSE;
|
gboolean store = FALSE;
|
||||||
gboolean flushpending = FALSE;
|
|
||||||
|
|
||||||
/* FLUSH_START/STOP : forward to all
|
/* FLUSH_START/STOP : forward to all
|
||||||
* INBAND events : store to send in chain function to selected chain
|
* INBAND events : store to send in chain function to selected chain
|
||||||
* OUT_OF_BAND events : send to all
|
* OUT_OF_BAND events : send to all
|
||||||
|
@ -179,8 +196,11 @@ gst_stream_splitter_sink_event (GstPad * pad, GstObject * parent,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_FLUSH_STOP:
|
case GST_EVENT_FLUSH_STOP:
|
||||||
flushpending = TRUE;
|
|
||||||
toall = TRUE;
|
toall = TRUE;
|
||||||
|
STREAMS_LOCK (stream_splitter);
|
||||||
|
stream_splitter->pending_events = _flush_events (stream_splitter->current,
|
||||||
|
stream_splitter->pending_events);
|
||||||
|
STREAMS_UNLOCK (stream_splitter);
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
toall = TRUE;
|
toall = TRUE;
|
||||||
|
@ -208,13 +228,6 @@ gst_stream_splitter_sink_event (GstPad * pad, GstObject * parent,
|
||||||
store = TRUE;
|
store = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flushpending) {
|
|
||||||
g_list_foreach (stream_splitter->pending_events, (GFunc) gst_event_unref,
|
|
||||||
NULL);
|
|
||||||
g_list_free (stream_splitter->pending_events);
|
|
||||||
stream_splitter->pending_events = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (store) {
|
if (store) {
|
||||||
stream_splitter->pending_events =
|
stream_splitter->pending_events =
|
||||||
g_list_append (stream_splitter->pending_events, event);
|
g_list_append (stream_splitter->pending_events, event);
|
||||||
|
|
Loading…
Reference in a new issue