diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-10-15 21:04:02 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2009-10-15 21:32:08 +0200 |
commit | 7ceeb14834ccd02b943513e629be95d0fdc5502c (patch) | |
tree | b6382a72ff4ec7146b2b3ad5c9f35bc0cc480070 /gst/avi/gstavidemux.c | |
parent | 354a062c89309e98ae616c44d1839a93a64d08b5 (diff) |
avidemux: adjust flow return aggregation to updated loop_data
In particular, each stream is now treated separately, and one stream's
EOS should not lead to overall EOS.
Diffstat (limited to 'gst/avi/gstavidemux.c')
-rw-r--r-- | gst/avi/gstavidemux.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 6071d545..e8f90f72 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -3820,12 +3820,13 @@ gst_avi_demux_combine_flows (GstAviDemux * avi, GstAviStream * stream, GstFlowReturn ret) { guint i; + gboolean unexpected = FALSE, not_linked = TRUE; /* store the value */ stream->last_flow = ret; - /* any other error that is not-linked can be returned right away */ - if (G_UNLIKELY (ret != GST_FLOW_NOT_LINKED)) + /* any other error that is not-linked or eos can be returned right away */ + if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED)) goto done; /* only return NOT_LINKED if all other pads returned NOT_LINKED */ @@ -3833,13 +3834,19 @@ gst_avi_demux_combine_flows (GstAviDemux * avi, GstAviStream * stream, GstAviStream *ostream = &avi->stream[i]; ret = ostream->last_flow; - /* some other return value (must be SUCCESS but we can return - * other values as well) */ - if (G_UNLIKELY (ret != GST_FLOW_NOT_LINKED)) + /* no unexpected or unlinked, return */ + if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED)) goto done; + + /* we check to see if we have at least 1 unexpected or all unlinked */ + unexpected |= (ret == GST_FLOW_UNEXPECTED); + not_linked &= (ret == GST_FLOW_NOT_LINKED); } - /* if we get here, all other pads were unlinked and we return - * NOT_LINKED then */ + /* when we get here, we all have unlinked or unexpected */ + if (not_linked) + ret = GST_FLOW_NOT_LINKED; + else if (unexpected) + ret = GST_FLOW_UNEXPECTED; done: GST_LOG_OBJECT (avi, "combined %s to return %s", gst_flow_get_name (stream->last_flow), gst_flow_get_name (ret)); |