mpegdemux: Don't use GST_FLOW_IS_FATAL()

And fix some minor issues related to its usage.
This commit is contained in:
Sebastian Dröge 2010-08-27 18:41:06 +02:00
parent dab5cbb1c0
commit f407d51ae8
3 changed files with 38 additions and 39 deletions

View file

@ -2684,7 +2684,6 @@ pause:
GST_LOG_OBJECT (demux, "pausing task, reason %s", reason);
gst_pad_pause_task (pad);
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) {
if (ret == GST_FLOW_UNEXPECTED) {
/* perform EOS logic */
gst_element_no_more_pads (GST_ELEMENT_CAST (demux));
@ -2719,13 +2718,12 @@ pause:
("Internal data stream error."), ("No valid streams detected"));
}
}
} else {
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
("Internal data stream error."),
("stream stopped, reason %s", reason));
gst_flups_demux_send_event (demux, gst_event_new_eos ());
}
}
gst_object_unref (demux);
return;

View file

@ -988,7 +988,7 @@ gst_mpegts_demux_combine_flows (GstMpegTSDemux * demux,
stream->last_ret = ret;
/* if it's success we can return the value right away */
if (GST_FLOW_IS_SUCCESS (ret))
if (ret == GST_FLOW_OK)
goto done;
/* any other error that is not-linked can be returned right

View file

@ -808,7 +808,8 @@ mpegts_parse_push (MpegTSParse * parse, MpegTSPacketizerPacket * packet,
}
tspad->pushed = TRUE;
if (G_UNLIKELY (GST_FLOW_IS_FATAL (tspad->flow_return))) {
if (G_UNLIKELY (tspad->flow_return != GST_FLOW_OK
&& tspad->flow_return != GST_FLOW_NOT_LINKED)) {
/* return the error upstream */
ret = tspad->flow_return;
done = TRUE;
@ -1249,7 +1250,7 @@ mpegts_parse_chain (GstPad * pad, GstBuffer * buf)
mpegts_packetizer_push (parse->packetizer, buf);
while (((pret =
mpegts_packetizer_next_packet (parse->packetizer,
&packet)) != PACKET_NEED_MORE) && !GST_FLOW_IS_FATAL (res)) {
&packet)) != PACKET_NEED_MORE) && res == GST_FLOW_OK) {
if (G_UNLIKELY (pret == PACKET_BAD))
/* bad header, skip the packet */
goto next;