mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
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.
This commit is contained in:
parent
354a062c89
commit
7ceeb14834
1 changed files with 14 additions and 7 deletions
|
@ -3820,12 +3820,13 @@ gst_avi_demux_combine_flows (GstAviDemux * avi, GstAviStream * stream,
|
||||||
GstFlowReturn ret)
|
GstFlowReturn ret)
|
||||||
{
|
{
|
||||||
guint i;
|
guint i;
|
||||||
|
gboolean unexpected = FALSE, not_linked = TRUE;
|
||||||
|
|
||||||
/* store the value */
|
/* store the value */
|
||||||
stream->last_flow = ret;
|
stream->last_flow = ret;
|
||||||
|
|
||||||
/* any other error that is not-linked can be returned right away */
|
/* any other error that is not-linked or eos can be returned right away */
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_NOT_LINKED))
|
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
/* only return NOT_LINKED if all other pads returned NOT_LINKED */
|
/* 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];
|
GstAviStream *ostream = &avi->stream[i];
|
||||||
|
|
||||||
ret = ostream->last_flow;
|
ret = ostream->last_flow;
|
||||||
/* some other return value (must be SUCCESS but we can return
|
/* no unexpected or unlinked, return */
|
||||||
* other values as well) */
|
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_NOT_LINKED))
|
|
||||||
goto done;
|
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
|
/* when we get here, we all have unlinked or unexpected */
|
||||||
* NOT_LINKED then */
|
if (not_linked)
|
||||||
|
ret = GST_FLOW_NOT_LINKED;
|
||||||
|
else if (unexpected)
|
||||||
|
ret = GST_FLOW_UNEXPECTED;
|
||||||
done:
|
done:
|
||||||
GST_LOG_OBJECT (avi, "combined %s to return %s",
|
GST_LOG_OBJECT (avi, "combined %s to return %s",
|
||||||
gst_flow_get_name (stream->last_flow), gst_flow_get_name (ret));
|
gst_flow_get_name (stream->last_flow), gst_flow_get_name (ret));
|
||||||
|
|
Loading…
Reference in a new issue