qtdemux: Don't use GST_FLOW_IS_FATAL()

This commit is contained in:
Sebastian Dröge 2010-08-27 17:39:32 +02:00
parent e8743b3789
commit 7fe34f3889

View file

@ -2934,46 +2934,43 @@ pause:
gst_pad_pause_task (pad); gst_pad_pause_task (pad);
/* fatal errors need special actions */ /* fatal errors need special actions */
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) { /* check EOS */
/* check EOS */ if (ret == GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_UNEXPECTED) { if (qtdemux->n_streams == 0) {
if (qtdemux->n_streams == 0) { /* we have no streams, post an error */
/* we have no streams, post an error */ gst_qtdemux_post_no_playable_stream_error (qtdemux);
gst_qtdemux_post_no_playable_stream_error (qtdemux); }
} if (qtdemux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
if (qtdemux->segment.flags & GST_SEEK_FLAG_SEGMENT) { gint64 stop;
gint64 stop;
/* FIXME: I am not sure this is the right fix. If the sinks are /* FIXME: I am not sure this is the right fix. If the sinks are
* supposed to detect the segment is complete and accumulate * supposed to detect the segment is complete and accumulate
* automatically, it does not seem to work here. Need more work */ * automatically, it does not seem to work here. Need more work */
qtdemux->segment_running = TRUE; qtdemux->segment_running = TRUE;
if ((stop = qtdemux->segment.stop) == -1) if ((stop = qtdemux->segment.stop) == -1)
stop = qtdemux->segment.duration; stop = qtdemux->segment.duration;
if (qtdemux->segment.rate >= 0) { if (qtdemux->segment.rate >= 0) {
GST_LOG_OBJECT (qtdemux, "Sending segment done, at end of segment"); GST_LOG_OBJECT (qtdemux, "Sending segment done, at end of segment");
gst_element_post_message (GST_ELEMENT_CAST (qtdemux), gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux), gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
GST_FORMAT_TIME, stop)); GST_FORMAT_TIME, stop));
} else {
/* For Reverse Playback */
GST_LOG_OBJECT (qtdemux,
"Sending segment done, at start of segment");
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
GST_FORMAT_TIME, qtdemux->segment.start));
}
} else { } else {
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment"); /* For Reverse Playback */
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ()); GST_LOG_OBJECT (qtdemux, "Sending segment done, at start of segment");
gst_element_post_message (GST_ELEMENT_CAST (qtdemux),
gst_message_new_segment_done (GST_OBJECT_CAST (qtdemux),
GST_FORMAT_TIME, qtdemux->segment.start));
} }
} else { } else {
GST_ELEMENT_ERROR (qtdemux, STREAM, FAILED, GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");
(NULL), ("streaming stopped, reason %s", reason));
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ()); gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
} }
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
GST_ELEMENT_ERROR (qtdemux, STREAM, FAILED,
(NULL), ("streaming stopped, reason %s", reason));
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
} }
goto done; goto done;
} }
@ -4151,7 +4148,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
/* sync sample atom */ /* sync sample atom */
stream->stps_present = FALSE; stream->stps_present = FALSE;
if ((stream->stss_present = if ((stream->stss_present =
!!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss, ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stss,
&stream->stss) ? TRUE : FALSE) == TRUE) { &stream->stss) ? TRUE : FALSE) == TRUE) {
/* copy atom data into a new buffer for later use */ /* copy atom data into a new buffer for later use */
stream->stss.data = g_memdup (stream->stss.data, stream->stss.size); stream->stss.data = g_memdup (stream->stss.data, stream->stss.size);
@ -4169,7 +4166,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
/* partial sync sample atom */ /* partial sync sample atom */
if ((stream->stps_present = if ((stream->stps_present =
!!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps, ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_stps,
&stream->stps) ? TRUE : FALSE) == TRUE) { &stream->stps) ? TRUE : FALSE) == TRUE) {
/* copy atom data into a new buffer for later use */ /* copy atom data into a new buffer for later use */
stream->stps.data = g_memdup (stream->stps.data, stream->stps.size); stream->stps.data = g_memdup (stream->stps.data, stream->stps.size);
@ -4293,7 +4290,7 @@ qtdemux_stbl_init (GstQTDemux * qtdemux, QtDemuxStream * stream, GNode * stbl)
/* composition time-to-sample */ /* composition time-to-sample */
if ((stream->ctts_present = if ((stream->ctts_present =
!!qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts, ! !qtdemux_tree_get_child_by_type_full (stbl, FOURCC_ctts,
&stream->ctts) ? TRUE : FALSE) == TRUE) { &stream->ctts) ? TRUE : FALSE) == TRUE) {
/* copy atom data into a new buffer for later use */ /* copy atom data into a new buffer for later use */
stream->ctts.data = g_memdup (stream->ctts.data, stream->ctts.size); stream->ctts.data = g_memdup (stream->ctts.data, stream->ctts.size);