summaryrefslogtreecommitdiffstats
path: root/gst/matroska/matroska-mux.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/matroska/matroska-mux.c')
-rw-r--r--gst/matroska/matroska-mux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c
index d1267067..cdd631e7 100644
--- a/gst/matroska/matroska-mux.c
+++ b/gst/matroska/matroska-mux.c
@@ -645,8 +645,8 @@ gst_matroska_mux_request_new_pad (GstElement * element,
pad = gst_pad_new_from_template (templ, name);
g_free (name);
- gst_element_add_pad (element, pad);
gst_pad_set_link_function (pad, linkfunc);
+ gst_element_add_pad (element, pad);
context->index = mux->num_streams++;
mux->sink[context->index].track = context;
context->pad = pad;
@@ -1132,6 +1132,11 @@ gst_matroska_mux_loop (GstElement * element)
GstMatroskaMux *mux = GST_MATROSKA_MUX (element);
guint i;
+ if (gst_matroska_mux_prepare_data (mux) == -1) {
+ GST_ELEMENT_ERROR (element, STREAM, MUX, (NULL), ("No data"));
+ return;
+ }
+
/* start with a header */
if (mux->state == GST_MATROSKA_MUX_STATE_START) {
if (mux->num_streams == 0) {