summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2016-05-14 23:39:22 +1000
committerJan Schmidt <jan@centricular.com>2016-05-15 00:03:15 +1000
commitfa008f271a52f82dededc28bd81b020ca7939b47 (patch)
tree7ebe798344c741d2c1bc636acfd29f2ace289a9c
parent183695c61a54f1a9628e5ef7dd951e904b29362a (diff)
splitmuxsink: Use GstBin async-handling instead of our own.
Set the async-handling property on GstBin to let it manage async-handling instead of the local handling from the previous commit. Works because of #174a5e in core
-rw-r--r--gst/multifile/gstsplitmuxsink.c19
-rw-r--r--gst/multifile/gstsplitmuxsink.h1
2 files changed, 1 insertions, 19 deletions
diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c
index 9cd3d01cb..88fdce0cc 100644
--- a/gst/multifile/gstsplitmuxsink.c
+++ b/gst/multifile/gstsplitmuxsink.c
@@ -248,6 +248,7 @@ gst_splitmux_sink_init (GstSplitMuxSink * splitmux)
splitmux->max_files = DEFAULT_MAX_FILES;
GST_OBJECT_FLAG_SET (splitmux, GST_ELEMENT_FLAG_SINK);
+ g_object_set (splitmux, "async-handling", TRUE, NULL);
}
static void
@@ -755,8 +756,6 @@ static void
start_next_fragment (GstSplitMuxSink * splitmux)
{
/* 1 change to new file */
- splitmux->switching_fragment = TRUE;
-
gst_element_set_locked_state (splitmux->muxer, TRUE);
gst_element_set_locked_state (splitmux->active_sink, TRUE);
gst_element_set_state (splitmux->muxer, GST_STATE_NULL);
@@ -769,8 +768,6 @@ start_next_fragment (GstSplitMuxSink * splitmux)
gst_element_set_locked_state (splitmux->muxer, FALSE);
gst_element_set_locked_state (splitmux->active_sink, FALSE);
- splitmux->switching_fragment = FALSE;
-
g_list_foreach (splitmux->contexts, (GFunc) restart_context, splitmux);
/* Switch state and go back to processing */
@@ -822,20 +819,6 @@ bus_handler (GstBin * bin, GstMessage * message)
}
GST_SPLITMUX_UNLOCK (splitmux);
break;
- case GST_MESSAGE_ASYNC_START:
- case GST_MESSAGE_ASYNC_DONE:
- /* Ignore state changes from our children while switching */
- if (splitmux->switching_fragment) {
- if (GST_MESSAGE_SRC (message) == (GstObject *) splitmux->active_sink ||
- GST_MESSAGE_SRC (message) == (GstObject *) splitmux->muxer) {
- GST_LOG_OBJECT (splitmux,
- "Ignoring state change from child %" GST_PTR_FORMAT
- " while switching", GST_MESSAGE_SRC (message));
- gst_message_unref (message);
- return;
- }
- }
- break;
default:
break;
}
diff --git a/gst/multifile/gstsplitmuxsink.h b/gst/multifile/gstsplitmuxsink.h
index 0fdb56b16..a233642c7 100644
--- a/gst/multifile/gstsplitmuxsink.h
+++ b/gst/multifile/gstsplitmuxsink.h
@@ -125,7 +125,6 @@ struct _GstSplitMuxSink {
gsize mux_start_bytes;
gboolean opening_first_fragment;
- gboolean switching_fragment;
};
struct _GstSplitMuxSinkClass {