mvedemux: Add proper flow return aggregation

NOT_LINKED should only be returned if all streams returned NOT_LINKED.
This commit is contained in:
Sebastian Dröge 2010-08-27 18:47:03 +02:00
parent f407d51ae8
commit f6713f9c3b
2 changed files with 13 additions and 2 deletions

View file

@ -317,6 +317,7 @@ gst_mve_video_init (GstMveDemux * mve, const guint8 * data)
stream->palette = NULL;
stream->caps = NULL;
stream->last_ts = GST_CLOCK_TIME_NONE;
stream->last_flow = GST_FLOW_OK;
mve->video_stream = stream;
}
@ -661,6 +662,7 @@ gst_mve_audio_init (GstMveDemux * mve, guint8 version, const guint8 * data,
stream = g_new0 (GstMveDemuxStream, 1);
stream->offset = 0;
stream->last_ts = 0;
stream->last_flow = GST_FLOW_OK;
mve->audio_stream = stream;
} else {
stream = mve->audio_stream;
@ -1037,10 +1039,17 @@ gst_mve_demux_chain (GstPad * sinkpad, GstBuffer * inbuf)
GST_BUFFER_SIZE (outbuf), GST_PAD_NAME (stream->pad));
ret = gst_pad_push (stream->pad, outbuf);
stream->last_flow = ret;
}
if (!GST_FLOW_IS_FATAL (ret))
ret = GST_FLOW_OK;
if (ret == GST_FLOW_NOT_LINKED) {
if (mve->audio_stream
&& mve->audio_stream->last_flow != GST_FLOW_NOT_LINKED)
ret = GST_FLOW_OK;
if (mve->video_stream
&& mve->video_stream->last_flow != GST_FLOW_NOT_LINKED)
ret = GST_FLOW_OK;
}
/* update current offset */
mve->chunk_offset += mve->needed_bytes;

View file

@ -78,6 +78,8 @@ struct _GstMveDemuxStream {
GstClockTime last_ts;
gint64 offset;
GstFlowReturn last_flow;
/* video properties */
guint16 width;
guint16 height;