mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
asfdemux: Check flow return on every push
We previously only aggregated flow returns after the while(push) loop, which meant that in some cases we would end-up not properly aggregating the flow returns. This is based on the same flow aggregation algorithm as oggdemux.
This commit is contained in:
parent
c77dfa7b9f
commit
bb20a20d86
1 changed files with 21 additions and 5 deletions
|
@ -874,23 +874,33 @@ parse_failed:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_asf_demux_aggregate_flow_return (GstASFDemux * demux)
|
gst_asf_demux_aggregate_flow_return (GstASFDemux * demux, AsfStream * stream,
|
||||||
|
GstFlowReturn flow)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "Aggregating");
|
GST_DEBUG_OBJECT (demux, "Aggregating");
|
||||||
|
|
||||||
|
/* Store the value */
|
||||||
|
stream->last_flow = flow;
|
||||||
|
|
||||||
|
/* any other error that is not not-linked can be returned right away */
|
||||||
|
if (flow != GST_FLOW_NOT_LINKED)
|
||||||
|
goto done;
|
||||||
|
|
||||||
for (i = 0; i < demux->num_streams; i++) {
|
for (i = 0; i < demux->num_streams; i++) {
|
||||||
if (demux->stream[i].active) {
|
if (demux->stream[i].active) {
|
||||||
GstFlowReturn flowret = demux->stream[i].last_flow;
|
GstFlowReturn flowret = demux->stream[i].last_flow;
|
||||||
GST_DEBUG_OBJECT (demux, "Aggregating: flow %i return %s", i,
|
GST_DEBUG_OBJECT (demux, "Aggregating: flow %i return %s", i,
|
||||||
gst_flow_get_name (flowret));
|
gst_flow_get_name (flowret));
|
||||||
if (flowret != GST_FLOW_NOT_LINKED)
|
if (flowret != GST_FLOW_NOT_LINKED)
|
||||||
return flowret;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we got here, then all our active streams are not linked */
|
/* If we got here, then all our active streams are not linked */
|
||||||
return GST_FLOW_NOT_LINKED;
|
done:
|
||||||
|
return flow;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -1275,6 +1285,7 @@ static GstFlowReturn
|
||||||
gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
|
gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
|
||||||
{
|
{
|
||||||
AsfStream *stream;
|
AsfStream *stream;
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
if (G_UNLIKELY (!demux->activated_streams)) {
|
if (G_UNLIKELY (!demux->activated_streams)) {
|
||||||
if (!gst_asf_demux_check_activate_streams (demux, force))
|
if (!gst_asf_demux_check_activate_streams (demux, force))
|
||||||
|
@ -1406,12 +1417,17 @@ gst_asf_demux_push_complete_payloads (GstASFDemux * demux, gboolean force)
|
||||||
GST_TIME_ARGS (GST_BUFFER_DURATION (payload->buf)),
|
GST_TIME_ARGS (GST_BUFFER_DURATION (payload->buf)),
|
||||||
GST_BUFFER_SIZE (payload->buf));
|
GST_BUFFER_SIZE (payload->buf));
|
||||||
|
|
||||||
stream->last_flow = gst_pad_push (stream->pad, payload->buf);
|
ret = gst_pad_push (stream->pad, payload->buf);
|
||||||
|
ret = gst_asf_demux_aggregate_flow_return (demux, stream, ret);
|
||||||
payload->buf = NULL;
|
payload->buf = NULL;
|
||||||
g_array_remove_index (stream->payloads, 0);
|
g_array_remove_index (stream->payloads, 0);
|
||||||
|
|
||||||
|
/* Break out as soon as we have an issue */
|
||||||
|
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return gst_asf_demux_aggregate_flow_return (demux);
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue