aboutsummaryrefslogtreecommitdiff
path: root/gst/matroska
diff options
context:
space:
mode:
Diffstat (limited to 'gst/matroska')
-rw-r--r--gst/matroska/matroska-demux.c48
-rw-r--r--gst/matroska/matroska-demux.h3
-rw-r--r--gst/matroska/matroska-ids.h1
-rw-r--r--gst/matroska/matroska-parse.c1
-rw-r--r--gst/matroska/matroska-read-common.c4
5 files changed, 10 insertions, 47 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 7fa71590..63ecfe1b 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -190,6 +190,7 @@ gst_matroska_demux_finalize (GObject * object)
GstMatroskaDemux *demux = GST_MATROSKA_DEMUX (object);
gst_matroska_read_common_finalize (&demux->common);
+ gst_flow_combiner_free (demux->flowcombiner);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -266,44 +267,7 @@ gst_matroska_demux_init (GstMatroskaDemux * demux)
/* finish off */
gst_matroska_demux_reset (GST_ELEMENT (demux));
-}
-
-/*
- * Returns the aggregated GstFlowReturn.
- */
-static GstFlowReturn
-gst_matroska_demux_combine_flows (GstMatroskaDemux * demux,
- GstMatroskaTrackContext * track, GstFlowReturn ret)
-{
- guint i;
-
- /* store the value */
- track->last_flow = ret;
-
- /* any other error that is not-linked can be returned right away */
- if (ret != GST_FLOW_NOT_LINKED)
- goto done;
-
- /* only return NOT_LINKED if all other pads returned NOT_LINKED */
- g_assert (demux->common.src->len == demux->common.num_streams);
- for (i = 0; i < demux->common.src->len; i++) {
- GstMatroskaTrackContext *ostream = g_ptr_array_index (demux->common.src,
- i);
-
- if (ostream == NULL)
- continue;
-
- ret = ostream->last_flow;
- /* some other return value (must be SUCCESS but we can return
- * other values as well) */
- if (ret != GST_FLOW_NOT_LINKED)
- goto done;
- }
- /* if we get here, all other pads were unlinked and we return
- * NOT_LINKED then */
-done:
- GST_LOG_OBJECT (demux, "combined return %s", gst_flow_get_name (ret));
- return ret;
+ demux->flowcombiner = gst_flow_combiner_new ();
}
static void
@@ -459,7 +423,6 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml)
context->flags =
GST_MATROSKA_TRACK_ENABLED | GST_MATROSKA_TRACK_DEFAULT |
GST_MATROSKA_TRACK_LACING;
- context->last_flow = GST_FLOW_OK;
context->from_time = GST_CLOCK_TIME_NONE;
context->from_offset = -1;
context->to_offset = G_MAXINT64;
@@ -1271,6 +1234,7 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml)
gst_pad_set_caps (context->pad, context->caps);
gst_element_add_pad (GST_ELEMENT (demux), context->pad);
+ gst_flow_combiner_add_pad (demux->flowcombiner, context->pad);
g_free (padname);
@@ -2555,7 +2519,7 @@ gst_matroska_demux_push_stream_headers (GstMatroskaDemux * demux,
stream->stream_headers = NULL;
/* combine flows */
- ret = gst_matroska_demux_combine_flows (demux, stream, ret);
+ ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
return ret;
}
@@ -3657,7 +3621,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
}
}
/* combine flows */
- ret = gst_matroska_demux_combine_flows (demux, stream, ret);
+ ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
next_lace:
size -= lace_size[n];
@@ -3683,7 +3647,7 @@ eos:
stream->eos = TRUE;
ret = GST_FLOW_OK;
/* combine flows */
- ret = gst_matroska_demux_combine_flows (demux, stream, ret);
+ ret = gst_flow_combiner_update_flow (demux->flowcombiner, ret);
goto done;
}
invalid_lacing:
diff --git a/gst/matroska/matroska-demux.h b/gst/matroska/matroska-demux.h
index 4453fe8f..36a686da 100644
--- a/gst/matroska/matroska-demux.h
+++ b/gst/matroska/matroska-demux.h
@@ -24,6 +24,7 @@
#define __GST_MATROSKA_DEMUX_H__
#include <gst/gst.h>
+#include <gst/base/gstflowcombiner.h>
#include "ebml-read.h"
#include "matroska-ids.h"
@@ -58,6 +59,8 @@ typedef struct _GstMatroskaDemux {
guint group_id;
gboolean have_group_id;
+ GstFlowCombiner *flowcombiner;
+
/* state */
gboolean streaming;
guint level_up;
diff --git a/gst/matroska/matroska-ids.h b/gst/matroska/matroska-ids.h
index f7eea2b5..68a68d40 100644
--- a/gst/matroska/matroska-ids.h
+++ b/gst/matroska/matroska-ids.h
@@ -497,7 +497,6 @@ struct _GstMatroskaTrackContext {
GstPad *pad;
GstCaps *caps;
guint index;
- GstFlowReturn last_flow;
/* reverse playback */
GstClockTime from_time;
gint64 from_offset;
diff --git a/gst/matroska/matroska-parse.c b/gst/matroska/matroska-parse.c
index c53bcf3f..4d3cb421 100644
--- a/gst/matroska/matroska-parse.c
+++ b/gst/matroska/matroska-parse.c
@@ -299,7 +299,6 @@ gst_matroska_parse_add_stream (GstMatroskaParse * parse, GstEbmlRead * ebml)
context->flags =
GST_MATROSKA_TRACK_ENABLED | GST_MATROSKA_TRACK_DEFAULT |
GST_MATROSKA_TRACK_LACING;
- context->last_flow = GST_FLOW_OK;
context->to_offset = G_MAXINT64;
context->alignment = 1;
parse->common.num_streams++;
diff --git a/gst/matroska/matroska-read-common.c b/gst/matroska/matroska-read-common.c
index ae5ea463..73381baf 100644
--- a/gst/matroska/matroska-read-common.c
+++ b/gst/matroska/matroska-read-common.c
@@ -1213,7 +1213,7 @@ gst_matroska_read_common_parse_header (GstMatroskaReadCommon * common,
if (num != GST_EBML_VERSION) {
GST_ERROR_OBJECT (ebml, "Unsupported EBML version %" G_GUINT64_FORMAT,
num);
- return GST_FLOW_ERROR;
+ goto exit_error;
}
GST_DEBUG_OBJECT (ebml, "EbmlReadVersion: %" G_GUINT64_FORMAT, num);
@@ -2959,8 +2959,6 @@ gst_matroska_read_common_reset_streams (GstMatroskaReadCommon * common,
context->set_discont = TRUE;
context->eos = FALSE;
context->from_time = GST_CLOCK_TIME_NONE;
- if (full)
- context->last_flow = GST_FLOW_OK;
if (context->type == GST_MATROSKA_TRACK_TYPE_VIDEO) {
GstMatroskaTrackVideoContext *videocontext =
(GstMatroskaTrackVideoContext *) context;