mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
GST_FLOW_UNEXPECTED -> GST_FLOW_EOS
This commit is contained in:
parent
386ccc52e7
commit
5fd2b7abe3
22 changed files with 125 additions and 126 deletions
|
@ -1656,7 +1656,7 @@ alloc_failed:
|
|||
GST_DEBUG_OBJECT (dec, "failed to alloc buffer, reason %s", reason);
|
||||
/* Reset for next time */
|
||||
jpeg_abort_decompress (&dec->cinfo);
|
||||
if (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_WRONG_STATE &&
|
||||
if (ret != GST_FLOW_EOS && ret != GST_FLOW_WRONG_STATE &&
|
||||
ret != GST_FLOW_NOT_LINKED) {
|
||||
gst_jpeg_dec_set_error (dec, GST_FUNCTION, __LINE__,
|
||||
"Buffer allocation failed, reason: %s", reason);
|
||||
|
|
|
@ -813,7 +813,7 @@ gst_soup_http_src_got_body_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
|
|||
return;
|
||||
}
|
||||
GST_DEBUG_OBJECT (src, "got body");
|
||||
src->ret = GST_FLOW_UNEXPECTED;
|
||||
src->ret = GST_FLOW_EOS;
|
||||
if (src->loop)
|
||||
g_main_loop_quit (src->loop);
|
||||
gst_soup_http_src_session_pause_message (src);
|
||||
|
@ -828,7 +828,7 @@ gst_soup_http_src_finished_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
|
|||
return;
|
||||
}
|
||||
GST_DEBUG_OBJECT (src, "finished");
|
||||
src->ret = GST_FLOW_UNEXPECTED;
|
||||
src->ret = GST_FLOW_EOS;
|
||||
if (src->session_io_status == GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_CANCELLED) {
|
||||
/* gst_soup_http_src_cancel_message() triggered this; probably a seek
|
||||
* that occurred in the QUEUEING state; i.e. before the connection setup
|
||||
|
@ -1110,7 +1110,7 @@ gst_soup_http_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
if (src->msg && (src->request_position != src->read_position)) {
|
||||
if (src->content_size != 0 && src->request_position >= src->content_size) {
|
||||
GST_WARNING_OBJECT (src, "Seeking behind the end of file -- EOS");
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
} else if (src->session_io_status ==
|
||||
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_IDLE) {
|
||||
gst_soup_http_src_add_range_header (src, src->request_position);
|
||||
|
@ -1164,7 +1164,7 @@ gst_soup_http_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
|
|||
} while (src->ret == GST_FLOW_CUSTOM_ERROR);
|
||||
|
||||
if (src->ret == GST_FLOW_CUSTOM_ERROR)
|
||||
src->ret = GST_FLOW_UNEXPECTED;
|
||||
src->ret = GST_FLOW_EOS;
|
||||
return src->ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -3928,7 +3928,7 @@ gst_avi_demux_move_stream (GstAviDemux * avi, GstAviStream * stream,
|
|||
guint next_key;
|
||||
/* Because we don't know the frame order we need to push from the prev keyframe
|
||||
* to the next keyframe. If there is a smart decoder downstream he will notice
|
||||
* that there are too many encoded frames send and return UNEXPECTED when there
|
||||
* that there are too many encoded frames send and return EOS when there
|
||||
* are enough decoded frames to fill the segment. */
|
||||
next_key = gst_avi_demux_index_next (avi, stream, index, TRUE);
|
||||
|
||||
|
@ -4497,7 +4497,7 @@ gst_avi_demux_combine_flows (GstAviDemux * avi, GstAviStream * stream,
|
|||
stream->last_flow = ret;
|
||||
|
||||
/* any other error that is not-linked or eos can be returned right away */
|
||||
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||
if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
|
||||
goto done;
|
||||
|
||||
/* only return NOT_LINKED if all other pads returned NOT_LINKED */
|
||||
|
@ -4506,18 +4506,18 @@ gst_avi_demux_combine_flows (GstAviDemux * avi, GstAviStream * stream,
|
|||
|
||||
ret = ostream->last_flow;
|
||||
/* no unexpected or unlinked, return */
|
||||
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||
if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
|
||||
goto done;
|
||||
|
||||
/* we check to see if we have at least 1 unexpected or all unlinked */
|
||||
unexpected |= (ret == GST_FLOW_UNEXPECTED);
|
||||
unexpected |= (ret == GST_FLOW_EOS);
|
||||
not_linked &= (ret == GST_FLOW_NOT_LINKED);
|
||||
}
|
||||
/* when we get here, we all have unlinked or unexpected */
|
||||
if (not_linked)
|
||||
ret = GST_FLOW_NOT_LINKED;
|
||||
else if (unexpected)
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
done:
|
||||
GST_LOG_OBJECT (avi, "combined %s to return %s",
|
||||
gst_flow_get_name (stream->last_flow), gst_flow_get_name (ret));
|
||||
|
@ -4597,7 +4597,7 @@ eos:
|
|||
GST_DEBUG_OBJECT (avi, "we are EOS");
|
||||
/* setting current_timestamp to -1 marks EOS */
|
||||
stream->current_timestamp = -1;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4621,7 +4621,7 @@ gst_avi_demux_find_next (GstAviDemux * avi, gfloat rate)
|
|||
stream = &avi->stream[i];
|
||||
|
||||
/* ignore streams that finished */
|
||||
if (stream->last_flow == GST_FLOW_UNEXPECTED)
|
||||
if (stream->last_flow == GST_FLOW_EOS)
|
||||
continue;
|
||||
|
||||
position = stream->current_timestamp;
|
||||
|
@ -4755,8 +4755,8 @@ gst_avi_demux_loop_data (GstAviDemux * avi)
|
|||
processed = TRUE;
|
||||
|
||||
if (avi->segment.rate < 0) {
|
||||
if (timestamp > avi->segment.stop && ret == GST_FLOW_UNEXPECTED) {
|
||||
/* In reverse playback we can get a GST_FLOW_UNEXPECTED when
|
||||
if (timestamp > avi->segment.stop && ret == GST_FLOW_EOS) {
|
||||
/* In reverse playback we can get a GST_FLOW_EOS when
|
||||
* we are at the end of the segment, so we just need to jump
|
||||
* back to the previous section. */
|
||||
GST_DEBUG_OBJECT (avi, "downstream has reached end of segment");
|
||||
|
@ -4778,7 +4778,7 @@ beach:
|
|||
eos:
|
||||
{
|
||||
GST_DEBUG_OBJECT (avi, "No samples left for any streams - EOS");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
eos_stop:
|
||||
|
@ -4786,7 +4786,7 @@ eos_stop:
|
|||
GST_LOG_OBJECT (avi, "Found keyframe after segment,"
|
||||
" setting EOS (%" GST_TIME_FORMAT " > %" GST_TIME_FORMAT ")",
|
||||
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (avi->segment.stop));
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
/* move to next stream */
|
||||
goto next;
|
||||
}
|
||||
|
@ -4802,7 +4802,7 @@ short_buffer:
|
|||
", only got %" G_GSIZE_FORMAT "/%" G_GUINT64_FORMAT
|
||||
" bytes (truncated file?)", offset, gst_buffer_get_size (buf), size);
|
||||
gst_buffer_unref (buf);
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
}
|
||||
|
@ -4822,7 +4822,7 @@ gst_avi_demux_stream_data (GstAviDemux * avi)
|
|||
if (G_UNLIKELY (avi->have_eos)) {
|
||||
/* Clean adapter, we're done */
|
||||
gst_adapter_clear (avi->adapter);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (avi->todrop)) {
|
||||
|
@ -4897,7 +4897,7 @@ gst_avi_demux_stream_data (GstAviDemux * avi)
|
|||
} else {
|
||||
GST_DEBUG ("No more stream chunks, send EOS");
|
||||
avi->have_eos = TRUE;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (!gst_avi_demux_peek_chunk (avi, &tag, &size))) {
|
||||
|
@ -5135,7 +5135,7 @@ pause:{
|
|||
GST_LOG_OBJECT (avi, "pausing task, reason %s", gst_flow_get_name (res));
|
||||
gst_pad_pause_task (avi->sinkpad);
|
||||
|
||||
if (res == GST_FLOW_UNEXPECTED) {
|
||||
if (res == GST_FLOW_EOS) {
|
||||
/* handle end-of-stream/segment */
|
||||
/* so align our position with the end of it, if there is one
|
||||
* this ensures a subsequent will arrive at correct base/acc time */
|
||||
|
@ -5159,7 +5159,7 @@ pause:{
|
|||
} else {
|
||||
push_eos = TRUE;
|
||||
}
|
||||
} else if (res == GST_FLOW_NOT_LINKED || res < GST_FLOW_UNEXPECTED) {
|
||||
} else if (res == GST_FLOW_NOT_LINKED || res < GST_FLOW_EOS) {
|
||||
/* for fatal errors we post an error message, wrong-state is
|
||||
* not fatal because it happens due to flushes and only means
|
||||
* that we should stop now. */
|
||||
|
@ -5171,7 +5171,7 @@ pause:{
|
|||
if (push_eos) {
|
||||
GST_INFO_OBJECT (avi, "sending eos");
|
||||
if (!gst_avi_demux_push_event (avi, gst_event_new_eos ()) &&
|
||||
(res == GST_FLOW_UNEXPECTED)) {
|
||||
(res == GST_FLOW_EOS)) {
|
||||
GST_ELEMENT_ERROR (avi, STREAM, DEMUX,
|
||||
(NULL), ("got eos but no streams (yet)"));
|
||||
}
|
||||
|
|
|
@ -2072,7 +2072,7 @@ gst_avi_mux_do_one_buffer (GstAviMux * avimux)
|
|||
/* simply finish off the file and send EOS */
|
||||
gst_avi_mux_stop_file (avimux);
|
||||
gst_pad_push_event (avimux->srcpad, gst_event_new_eos ());
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
/* ERRORS */
|
||||
|
|
|
@ -281,7 +281,7 @@ gst_avi_subtitle_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
|
||||
if (sub->subfile != NULL) {
|
||||
GST_WARNING_OBJECT (sub, "Got more buffers than expected, dropping");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ pause_task:
|
|||
|
||||
pull_failed:
|
||||
{
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
GST_DEBUG_OBJECT (self, "eos");
|
||||
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
|
||||
} else {
|
||||
|
@ -332,10 +332,10 @@ pull_failed:
|
|||
push_failed:
|
||||
{
|
||||
GST_DEBUG_OBJECT (self, "push flow: %s", gst_flow_get_name (ret));
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
GST_DEBUG_OBJECT (self, "eos");
|
||||
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
|
||||
} else if (ret < GST_FLOW_UNEXPECTED || ret == GST_FLOW_NOT_LINKED) {
|
||||
} else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) {
|
||||
GST_ELEMENT_ERROR (self, STREAM, FAILED,
|
||||
("Internal data stream error."),
|
||||
("streaming stopped, reason: %s", gst_flow_get_name (ret)));
|
||||
|
|
|
@ -1073,9 +1073,9 @@ gst_flv_demux_parse_tag_audio (GstFlvDemux * demux, GstBuffer * buffer)
|
|||
/* Push downstream */
|
||||
ret = gst_pad_push (demux->audio_pad, outbuf);
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
|
||||
if (demux->segment.rate < 0.0 && ret == GST_FLOW_UNEXPECTED &&
|
||||
if (demux->segment.rate < 0.0 && ret == GST_FLOW_EOS &&
|
||||
demux->segment.position > demux->segment.stop) {
|
||||
/* In reverse playback we can get a GST_FLOW_UNEXPECTED when
|
||||
/* In reverse playback we can get a GST_FLOW_EOS when
|
||||
* we are at the end of the segment, so we just need to jump
|
||||
* back to the previous section. */
|
||||
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
|
||||
|
@ -1453,9 +1453,9 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
|
|||
ret = gst_pad_push (demux->video_pad, outbuf);
|
||||
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
|
||||
if (demux->segment.rate < 0.0 && ret == GST_FLOW_UNEXPECTED &&
|
||||
if (demux->segment.rate < 0.0 && ret == GST_FLOW_EOS &&
|
||||
demux->segment.position > demux->segment.stop) {
|
||||
/* In reverse playback we can get a GST_FLOW_UNEXPECTED when
|
||||
/* In reverse playback we can get a GST_FLOW_EOS when
|
||||
* we are at the end of the segment, so we just need to jump
|
||||
* back to the previous section. */
|
||||
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
|
||||
|
@ -1613,7 +1613,7 @@ gst_flv_demux_parse_header (GstFlvDemux * demux, GstBuffer * buffer)
|
|||
} else {
|
||||
if (G_UNLIKELY (demux->strict)) {
|
||||
GST_WARNING_OBJECT (demux, "invalid header tag detected");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
}
|
||||
|
@ -2037,7 +2037,7 @@ gst_flv_demux_pull_range (GstFlvDemux * demux, GstPad * pad, guint64 offset,
|
|||
"partial pull got %" G_GSIZE_FORMAT " when expecting %d from offset %"
|
||||
G_GUINT64_FORMAT, gst_buffer_get_size (*buffer), size, offset);
|
||||
gst_buffer_unref (*buffer);
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
*buffer = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
@ -2168,7 +2168,7 @@ gst_flv_demux_move_to_offset (GstFlvDemux * demux, gint64 offset,
|
|||
static GstFlowReturn
|
||||
gst_flv_demux_seek_to_prev_keyframe (GstFlvDemux * demux)
|
||||
{
|
||||
GstFlowReturn ret = GST_FLOW_UNEXPECTED;
|
||||
GstFlowReturn ret = GST_FLOW_EOS;
|
||||
GstIndexEntry *entry = NULL;
|
||||
|
||||
GST_DEBUG_OBJECT (demux,
|
||||
|
@ -2245,7 +2245,7 @@ gst_flv_demux_create_index (GstFlvDemux * demux, gint64 pos, GstClockTime ts)
|
|||
demux->offset += tag_size;
|
||||
}
|
||||
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* file ran out, so mark we have complete index */
|
||||
demux->indexed = TRUE;
|
||||
ret = GST_FLOW_OK;
|
||||
|
@ -2347,7 +2347,7 @@ gst_flv_demux_loop (GstPad * pad)
|
|||
demux->file_size = gst_flv_demux_get_metadata (demux);
|
||||
break;
|
||||
case FLV_STATE_DONE:
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
break;
|
||||
case FLV_STATE_SEEK:
|
||||
/* seek issued with insufficient index;
|
||||
|
@ -2380,7 +2380,7 @@ gst_flv_demux_loop (GstPad * pad)
|
|||
/* check EOS condition */
|
||||
if ((demux->segment.stop != -1) &&
|
||||
(demux->segment.position >= demux->segment.stop)) {
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2399,7 +2399,7 @@ pause:
|
|||
GST_LOG_OBJECT (demux, "pausing task, reason %s", reason);
|
||||
gst_pad_pause_task (pad);
|
||||
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* handle end-of-stream/segment */
|
||||
/* so align our position with the end of it, if there is one
|
||||
* this ensures a subsequent will arrive at correct base/acc time */
|
||||
|
@ -2446,7 +2446,7 @@ pause:
|
|||
if (!gst_flv_demux_push_src_event (demux, gst_event_new_eos ()))
|
||||
GST_WARNING_OBJECT (demux, "failed pushing EOS on streams");
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
||||
("Internal data stream error."),
|
||||
("stream stopped, reason %s", reason));
|
||||
|
|
|
@ -1511,7 +1511,7 @@ gst_flv_mux_collected (GstCollectPads * pads, gpointer user_data)
|
|||
} else if (eos) {
|
||||
gst_flv_mux_rewrite_header (mux);
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
} else {
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
|
@ -2536,7 +2536,7 @@ gst_qt_mux_collected (GstCollectPads * pads, gpointer user_data)
|
|||
}
|
||||
|
||||
if (G_UNLIKELY (qtmux->state == GST_QT_MUX_STATE_EOS))
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
|
||||
/* select the best buffer */
|
||||
walk = qtmux->collect->data;
|
||||
|
@ -2590,7 +2590,7 @@ gst_qt_mux_collected (GstCollectPads * pads, gpointer user_data)
|
|||
if (ret == GST_FLOW_OK) {
|
||||
GST_DEBUG_OBJECT (qtmux, "Pushing eos");
|
||||
gst_pad_push_event (qtmux->srcpad, gst_event_new_eos ());
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
} else {
|
||||
GST_WARNING_OBJECT (qtmux, "Failed to stop file: %s",
|
||||
gst_flow_get_name (ret));
|
||||
|
|
|
@ -587,7 +587,7 @@ gst_qtdemux_pull_atom (GstQTDemux * qtdemux, guint64 offset, guint64 size,
|
|||
* so never mind the rest (e.g. tags) (that much) */
|
||||
GST_WARNING_OBJECT (qtdemux, "atom has bogus size %" G_GUINT64_FORMAT,
|
||||
size);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
} else {
|
||||
GST_ELEMENT_ERROR (qtdemux, STREAM, DEMUX,
|
||||
(_("This file is invalid and cannot be played.")),
|
||||
|
@ -608,7 +608,7 @@ gst_qtdemux_pull_atom (GstQTDemux * qtdemux, guint64 offset, guint64 size,
|
|||
"short read: %" G_GSIZE_FORMAT " < %" G_GUINT64_FORMAT, bsize, size);
|
||||
gst_buffer_unref (*buf);
|
||||
*buf = NULL;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
return flow;
|
||||
|
@ -2664,7 +2664,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
|
|||
(_("Invalid atom size.")),
|
||||
("Header atom '%" GST_FOURCC_FORMAT "' has empty length",
|
||||
GST_FOURCC_ARGS (fourcc)));
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
|
||||
|
@ -2800,7 +2800,7 @@ gst_qtdemux_loop_state_header (GstQTDemux * qtdemux)
|
|||
}
|
||||
|
||||
beach:
|
||||
if (ret == GST_FLOW_UNEXPECTED && qtdemux->got_moov) {
|
||||
if (ret == GST_FLOW_EOS && qtdemux->got_moov) {
|
||||
/* digested all data, show what we have */
|
||||
ret = qtdemux_expose_streams (qtdemux);
|
||||
|
||||
|
@ -2980,7 +2980,7 @@ gst_qtdemux_seek_to_previous_keyframe (GstQTDemux * qtdemux)
|
|||
return GST_FLOW_OK;
|
||||
|
||||
eos:
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
/* activate the given segment number @seg_idx of @stream at time @offset.
|
||||
|
@ -3360,10 +3360,10 @@ gst_qtdemux_sync_streams (GstQTDemux * demux)
|
|||
}
|
||||
}
|
||||
|
||||
/* UNEXPECTED and NOT_LINKED need to be combined. This means that we return:
|
||||
/* EOS and NOT_LINKED need to be combined. This means that we return:
|
||||
*
|
||||
* GST_FLOW_NOT_LINKED: when all pads NOT_LINKED.
|
||||
* GST_FLOW_UNEXPECTED: when all pads UNEXPECTED or NOT_LINKED.
|
||||
* GST_FLOW_EOS: when all pads EOS or NOT_LINKED.
|
||||
*/
|
||||
static GstFlowReturn
|
||||
gst_qtdemux_combine_flows (GstQTDemux * demux, QtDemuxStream * stream,
|
||||
|
@ -3378,7 +3378,7 @@ gst_qtdemux_combine_flows (GstQTDemux * demux, QtDemuxStream * stream,
|
|||
stream->last_ret = ret;
|
||||
|
||||
/* any other error that is not-linked or eos can be returned right away */
|
||||
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||
if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
|
||||
goto done;
|
||||
|
||||
/* only return NOT_LINKED if all other pads returned NOT_LINKED */
|
||||
|
@ -3388,11 +3388,11 @@ gst_qtdemux_combine_flows (GstQTDemux * demux, QtDemuxStream * stream,
|
|||
ret = ostream->last_ret;
|
||||
|
||||
/* no unexpected or unlinked, return */
|
||||
if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
|
||||
if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
|
||||
goto done;
|
||||
|
||||
/* we check to see if we have at least 1 unexpected or all unlinked */
|
||||
unexpected |= (ret == GST_FLOW_UNEXPECTED);
|
||||
unexpected |= (ret == GST_FLOW_EOS);
|
||||
not_linked &= (ret == GST_FLOW_NOT_LINKED);
|
||||
}
|
||||
|
||||
|
@ -3400,7 +3400,7 @@ gst_qtdemux_combine_flows (GstQTDemux * demux, QtDemuxStream * stream,
|
|||
if (not_linked)
|
||||
ret = GST_FLOW_NOT_LINKED;
|
||||
else if (unexpected)
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
done:
|
||||
GST_LOG_OBJECT (demux, "combined flow return: %s", gst_flow_get_name (ret));
|
||||
return ret;
|
||||
|
@ -3751,7 +3751,7 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
|||
goto next;
|
||||
|
||||
/* last pushed sample was out of boundary, goto next sample */
|
||||
if (G_UNLIKELY (stream->last_ret == GST_FLOW_UNEXPECTED))
|
||||
if (G_UNLIKELY (stream->last_ret == GST_FLOW_EOS))
|
||||
goto next;
|
||||
|
||||
GST_LOG_OBJECT (qtdemux, "reading %d bytes @ %" G_GUINT64_FORMAT, size,
|
||||
|
@ -3768,7 +3768,7 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux)
|
|||
ret = gst_qtdemux_combine_flows (qtdemux, stream, ret);
|
||||
/* ignore unlinked, we will not push on the pad anymore and we will EOS when
|
||||
* we have no more data for the pad to push */
|
||||
if (ret == GST_FLOW_UNEXPECTED)
|
||||
if (ret == GST_FLOW_EOS)
|
||||
ret = GST_FLOW_OK;
|
||||
|
||||
next:
|
||||
|
@ -3781,7 +3781,7 @@ beach:
|
|||
eos:
|
||||
{
|
||||
GST_DEBUG_OBJECT (qtdemux, "No samples left for any streams - EOS");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
eos_stream:
|
||||
|
@ -3813,7 +3813,7 @@ gst_qtdemux_loop (GstPad * pad)
|
|||
break;
|
||||
case QTDEMUX_STATE_MOVIE:
|
||||
ret = gst_qtdemux_loop_state_movie (qtdemux);
|
||||
if (qtdemux->segment.rate < 0 && ret == GST_FLOW_UNEXPECTED) {
|
||||
if (qtdemux->segment.rate < 0 && ret == GST_FLOW_EOS) {
|
||||
ret = gst_qtdemux_seek_to_previous_keyframe (qtdemux);
|
||||
}
|
||||
break;
|
||||
|
@ -3849,7 +3849,7 @@ pause:
|
|||
|
||||
/* fatal errors need special actions */
|
||||
/* check EOS */
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
if (qtdemux->n_streams == 0) {
|
||||
/* we have no streams, post an error */
|
||||
gst_qtdemux_post_no_playable_stream_error (qtdemux);
|
||||
|
@ -3876,7 +3876,7 @@ pause:
|
|||
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");
|
||||
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
GST_ELEMENT_ERROR (qtdemux, STREAM, FAILED,
|
||||
(NULL), ("streaming stopped, reason %s", reason));
|
||||
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
|
||||
|
@ -4411,7 +4411,7 @@ unknown_stream:
|
|||
eos:
|
||||
{
|
||||
GST_DEBUG_OBJECT (demux, "no next entry, EOS");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto done;
|
||||
}
|
||||
invalid_state:
|
||||
|
@ -5182,7 +5182,7 @@ qtdemux_find_atom (GstQTDemux * qtdemux, guint64 * offset,
|
|||
goto locate_failed;
|
||||
if (G_UNLIKELY (gst_buffer_get_size (buf) != 16)) {
|
||||
/* likely EOF */
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
gst_buffer_unref (buf);
|
||||
goto locate_failed;
|
||||
}
|
||||
|
@ -5236,7 +5236,7 @@ qtdemux_add_fragmented_samples (GstQTDemux * qtdemux)
|
|||
|
||||
if (!offset) {
|
||||
GST_DEBUG_OBJECT (qtdemux, "no next moof");
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
/* best not do pull etc with lock held */
|
||||
|
|
|
@ -45,7 +45,7 @@ GST_DEBUG_CATEGORY (ebmlread_debug);
|
|||
|
||||
/* Peeks following element id and element length in datastream provided
|
||||
* by @peek with @ctx as user data.
|
||||
* Returns GST_FLOW_UNEXPECTED if not enough data to read id and length.
|
||||
* Returns GST_FLOW_EOS if not enough data to read id and length.
|
||||
* Otherwise, @needed provides the prefix length (id + length), and
|
||||
* @length provides element length.
|
||||
*
|
||||
|
@ -199,7 +199,7 @@ gst_ebml_read_peek (GstByteReader * br, guint peek, const guint8 ** data)
|
|||
if (G_LIKELY (gst_byte_reader_peek_data (br, peek, data)))
|
||||
return GST_FLOW_OK;
|
||||
else
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
|
@ -1186,8 +1186,8 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux, GstEbmlRead * ebml)
|
|||
}
|
||||
|
||||
if (context->type == 0 || context->codec_id == NULL || (ret != GST_FLOW_OK
|
||||
&& ret != GST_FLOW_UNEXPECTED)) {
|
||||
if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
|
||||
&& ret != GST_FLOW_EOS)) {
|
||||
if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
|
||||
GST_WARNING_OBJECT (ebml, "Unknown stream/codec in track entry header");
|
||||
|
||||
demux->common.num_streams--;
|
||||
|
@ -1775,7 +1775,7 @@ retry:
|
|||
while (1) {
|
||||
|
||||
ret = gst_matroska_demux_search_cluster (demux, &newpos);
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* heuristic HACK */
|
||||
newpos = startpos * 80 / 100;
|
||||
GST_DEBUG_OBJECT (demux, "EOS; "
|
||||
|
@ -1860,7 +1860,7 @@ retry:
|
|||
continue;
|
||||
|
||||
error:
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
if (prev_cluster_time != GST_CLOCK_TIME_NONE)
|
||||
break;
|
||||
}
|
||||
|
@ -2224,13 +2224,13 @@ gst_matroska_demux_handle_src_event (GstPad * pad, GstObject * parent,
|
|||
static GstFlowReturn
|
||||
gst_matroska_demux_seek_to_previous_keyframe (GstMatroskaDemux * demux)
|
||||
{
|
||||
GstFlowReturn ret = GST_FLOW_UNEXPECTED;
|
||||
GstFlowReturn ret = GST_FLOW_EOS;
|
||||
gboolean done = TRUE;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (demux->seek_index, GST_FLOW_UNEXPECTED);
|
||||
g_return_val_if_fail (demux->seek_index, GST_FLOW_EOS);
|
||||
g_return_val_if_fail (demux->seek_entry < demux->seek_index->len,
|
||||
GST_FLOW_UNEXPECTED);
|
||||
GST_FLOW_EOS);
|
||||
|
||||
GST_DEBUG_OBJECT (demux, "locating previous keyframe");
|
||||
|
||||
|
@ -3606,9 +3606,8 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
|||
|
||||
ret = gst_pad_push (stream->pad, sub);
|
||||
if (demux->common.segment.rate < 0) {
|
||||
if (lace_time > demux->common.segment.stop
|
||||
&& ret == GST_FLOW_UNEXPECTED) {
|
||||
/* In reverse playback we can get a GST_FLOW_UNEXPECTED when
|
||||
if (lace_time > demux->common.segment.stop && ret == GST_FLOW_EOS) {
|
||||
/* In reverse playback we can get a GST_FLOW_EOS when
|
||||
* we are at the end of the segment, so we just need to jump
|
||||
* back to the previous section. */
|
||||
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
|
||||
|
@ -3735,7 +3734,7 @@ gst_matroska_demux_parse_contents_seekentry (GstMatroskaDemux * demux,
|
|||
}
|
||||
}
|
||||
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
|
||||
return ret;
|
||||
|
||||
if (!seek_id || seek_pos == (guint64) - 1) {
|
||||
|
@ -3948,13 +3947,13 @@ gst_matroska_demux_flush (GstMatroskaDemux * demux, guint flush)
|
|||
if (flush <= gst_adapter_available (demux->common.adapter))
|
||||
gst_adapter_flush (demux->common.adapter, flush);
|
||||
else
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
||||
/* initializes @ebml with @bytes from input stream at current offset.
|
||||
* Returns UNEXPECTED if insufficient available,
|
||||
* Returns EOS if insufficient available,
|
||||
* ERROR if too much was attempted to read. */
|
||||
static inline GstFlowReturn
|
||||
gst_matroska_demux_take (GstMatroskaDemux * demux, guint64 bytes,
|
||||
|
@ -3981,7 +3980,7 @@ gst_matroska_demux_take (GstMatroskaDemux * demux, guint64 bytes,
|
|||
if (gst_adapter_available (demux->common.adapter) >= bytes)
|
||||
buffer = gst_adapter_take_buffer (demux->common.adapter, bytes);
|
||||
else
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
} else
|
||||
ret = gst_matroska_read_common_peek_bytes (&demux->common,
|
||||
demux->common.offset, bytes, &buffer, NULL);
|
||||
|
@ -4389,7 +4388,7 @@ gst_matroska_demux_loop (GstPad * pad)
|
|||
|
||||
ret = gst_matroska_read_common_peek_id_length_pull (&demux->common,
|
||||
GST_ELEMENT_CAST (demux), &id, &length, &needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED)
|
||||
if (ret == GST_FLOW_EOS)
|
||||
goto eos;
|
||||
if (ret != GST_FLOW_OK) {
|
||||
if (gst_matroska_demux_check_parse_error (demux))
|
||||
|
@ -4403,7 +4402,7 @@ gst_matroska_demux_loop (GstPad * pad)
|
|||
length, needed);
|
||||
|
||||
ret = gst_matroska_demux_parse_id (demux, id, length, needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED)
|
||||
if (ret == GST_FLOW_EOS)
|
||||
goto eos;
|
||||
if (ret != GST_FLOW_OK)
|
||||
goto pause;
|
||||
|
@ -4423,7 +4422,7 @@ gst_matroska_demux_loop (GstPad * pad)
|
|||
}
|
||||
|
||||
GST_INFO_OBJECT (demux, "All streams are EOS");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto eos;
|
||||
}
|
||||
|
||||
|
@ -4431,7 +4430,7 @@ next:
|
|||
if (G_UNLIKELY (demux->common.offset ==
|
||||
gst_matroska_read_common_get_length (&demux->common))) {
|
||||
GST_LOG_OBJECT (demux, "Reached end of stream");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto eos;
|
||||
}
|
||||
|
||||
|
@ -4456,7 +4455,7 @@ pause:
|
|||
demux->segment_running = FALSE;
|
||||
gst_pad_pause_task (demux->common.sinkpad);
|
||||
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* perform EOS logic */
|
||||
|
||||
/* If we were in the headers, make sure we send no-more-pads.
|
||||
|
@ -4500,7 +4499,7 @@ pause:
|
|||
} else {
|
||||
push_eos = TRUE;
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
/* for fatal errors we post an error message */
|
||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED, (NULL),
|
||||
("stream stopped, reason %s", reason));
|
||||
|
@ -4510,7 +4509,7 @@ pause:
|
|||
/* send EOS, and prevent hanging if no streams yet */
|
||||
GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
|
||||
if (!gst_matroska_demux_send_event (demux, gst_event_new_eos ()) &&
|
||||
(ret == GST_FLOW_UNEXPECTED)) {
|
||||
(ret == GST_FLOW_EOS)) {
|
||||
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
|
||||
(NULL), ("got eos but no streams (yet)"));
|
||||
}
|
||||
|
@ -4568,7 +4567,7 @@ next:
|
|||
|
||||
ret = gst_matroska_read_common_peek_id_length_push (&demux->common,
|
||||
GST_ELEMENT_CAST (demux), &id, &length, &needed);
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED))
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS))
|
||||
return ret;
|
||||
|
||||
GST_LOG_OBJECT (demux, "Offset %" G_GUINT64_FORMAT ", Element id 0x%x, "
|
||||
|
@ -4579,7 +4578,7 @@ next:
|
|||
return GST_FLOW_OK;
|
||||
|
||||
ret = gst_matroska_demux_parse_id (demux, id, length, needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* need more data */
|
||||
return GST_FLOW_OK;
|
||||
} else if (ret != GST_FLOW_OK) {
|
||||
|
|
|
@ -3003,7 +3003,7 @@ gst_matroska_mux_collected (GstCollectPads * pads, gpointer user_data)
|
|||
GST_DEBUG_OBJECT (mux, "... but streamable, nothing to finish");
|
||||
}
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
break;
|
||||
}
|
||||
GST_DEBUG_OBJECT (best->collect.pad, "best pad - buffer ts %"
|
||||
|
|
|
@ -1048,8 +1048,8 @@ gst_matroska_parse_add_stream (GstMatroskaParse * parse, GstEbmlRead * ebml)
|
|||
}
|
||||
|
||||
if (context->type == 0 || context->codec_id == NULL || (ret != GST_FLOW_OK
|
||||
&& ret != GST_FLOW_UNEXPECTED)) {
|
||||
if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
|
||||
&& ret != GST_FLOW_EOS)) {
|
||||
if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
|
||||
GST_WARNING_OBJECT (ebml, "Unknown stream/codec in track entry header");
|
||||
|
||||
parse->common.num_streams--;
|
||||
|
@ -2101,8 +2101,8 @@ gst_matroska_parse_parse_blockgroup_or_simpleblock (GstMatroskaParse * parse,
|
|||
|
||||
ret = gst_pad_push (stream->pad, sub);
|
||||
if (parse->segment.rate < 0) {
|
||||
if (lace_time > parse->segment.stop && ret == GST_FLOW_UNEXPECTED) {
|
||||
/* In reverse playback we can get a GST_FLOW_UNEXPECTED when
|
||||
if (lace_time > parse->segment.stop && ret == GST_FLOW_EOS) {
|
||||
/* In reverse playback we can get a GST_FLOW_EOS when
|
||||
* we are at the end of the segment, so we just need to jump
|
||||
* back to the previous section. */
|
||||
GST_DEBUG_OBJECT (parse, "downstream has reached end of segment");
|
||||
|
@ -2222,7 +2222,7 @@ gst_matroska_parse_parse_contents_seekentry (GstMatroskaParse * parse,
|
|||
}
|
||||
}
|
||||
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
|
||||
return ret;
|
||||
|
||||
if (!seek_id || seek_pos == (guint64) - 1) {
|
||||
|
@ -2363,7 +2363,7 @@ gst_matroska_parse_check_parse_error (GstMatroskaParse * parse)
|
|||
}
|
||||
|
||||
/* initializes @ebml with @bytes from input stream at current offset.
|
||||
* Returns UNEXPECTED if insufficient available,
|
||||
* Returns EOS if insufficient available,
|
||||
* ERROR if too much was attempted to read. */
|
||||
static inline GstFlowReturn
|
||||
gst_matroska_parse_take (GstMatroskaParse * parse, guint64 bytes,
|
||||
|
@ -2383,7 +2383,7 @@ gst_matroska_parse_take (GstMatroskaParse * parse, guint64 bytes,
|
|||
if (gst_adapter_available (parse->common.adapter) >= bytes)
|
||||
buffer = gst_adapter_take_buffer (parse->common.adapter, bytes);
|
||||
else
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
if (G_LIKELY (buffer)) {
|
||||
gst_ebml_read_init (ebml, GST_ELEMENT_CAST (parse), buffer,
|
||||
parse->common.offset);
|
||||
|
@ -2584,7 +2584,7 @@ gst_matroska_parse_parse_id (GstMatroskaParse * parse, guint32 id,
|
|||
buffer = gst_adapter_take_buffer (parse->adapter, length + needed);
|
||||
gst_pad_push (parse->srcpad, buffer);
|
||||
} else {
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
}
|
||||
//GST_READ_CHECK (gst_matroska_parse_take (parse, read, &ebml));
|
||||
|
||||
|
@ -2884,7 +2884,7 @@ gst_matroska_parse_loop (GstPad * pad)
|
|||
|
||||
ret = gst_matroska_read_common_peek_id_length_pull (&parse->common,
|
||||
GST_ELEMENT_CAST (parse), &id, &length, &needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED)
|
||||
if (ret == GST_FLOW_EOS)
|
||||
goto eos;
|
||||
if (ret != GST_FLOW_OK) {
|
||||
if (gst_matroska_parse_check_parse_error (parse))
|
||||
|
@ -2898,7 +2898,7 @@ gst_matroska_parse_loop (GstPad * pad)
|
|||
length, needed);
|
||||
|
||||
ret = gst_matroska_parse_parse_id (parse, id, length, needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED)
|
||||
if (ret == GST_FLOW_EOS)
|
||||
goto eos;
|
||||
if (ret != GST_FLOW_OK)
|
||||
goto pause;
|
||||
|
@ -2917,7 +2917,7 @@ gst_matroska_parse_loop (GstPad * pad)
|
|||
}
|
||||
|
||||
GST_INFO_OBJECT (parse, "All streams are EOS");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto eos;
|
||||
}
|
||||
|
||||
|
@ -2925,7 +2925,7 @@ next:
|
|||
if (G_UNLIKELY (parse->offset ==
|
||||
gst_matroska_read_common_get_length (&parse->common))) {
|
||||
GST_LOG_OBJECT (parse, "Reached end of stream");
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto eos;
|
||||
}
|
||||
|
||||
|
@ -2950,7 +2950,7 @@ pause:
|
|||
parse->segment_running = FALSE;
|
||||
gst_pad_pause_task (parse->common.sinkpad);
|
||||
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* perform EOS logic */
|
||||
|
||||
/* Close the segment, i.e. update segment stop with the duration
|
||||
|
@ -2981,7 +2981,7 @@ pause:
|
|||
} else {
|
||||
push_eos = TRUE;
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
/* for fatal errors we post an error message */
|
||||
GST_ELEMENT_ERROR (parse, STREAM, FAILED, (NULL),
|
||||
("stream stopped, reason %s", reason));
|
||||
|
@ -2991,7 +2991,7 @@ pause:
|
|||
/* send EOS, and prevent hanging if no streams yet */
|
||||
GST_LOG_OBJECT (parse, "Sending EOS, at end of stream");
|
||||
if (!gst_matroska_parse_send_event (parse, gst_event_new_eos ()) &&
|
||||
(ret == GST_FLOW_UNEXPECTED)) {
|
||||
(ret == GST_FLOW_EOS)) {
|
||||
GST_ELEMENT_ERROR (parse, STREAM, DEMUX,
|
||||
(NULL), ("got eos but no streams (yet)"));
|
||||
}
|
||||
|
@ -3050,7 +3050,7 @@ next:
|
|||
|
||||
ret = gst_matroska_read_common_peek_id_length_push (&parse->common,
|
||||
GST_ELEMENT_CAST (parse), &id, &length, &needed);
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED))
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS))
|
||||
return ret;
|
||||
|
||||
GST_LOG_OBJECT (parse, "Offset %" G_GUINT64_FORMAT ", Element id 0x%x, "
|
||||
|
@ -3061,7 +3061,7 @@ next:
|
|||
return GST_FLOW_OK;
|
||||
|
||||
ret = gst_matroska_parse_parse_id (parse, id, length, needed);
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* need more data */
|
||||
return GST_FLOW_OK;
|
||||
} else if (ret != GST_FLOW_OK) {
|
||||
|
|
|
@ -999,11 +999,11 @@ gst_matroska_read_common_parse_index_cuetrack (GstMatroskaReadCommon * common,
|
|||
|
||||
DEBUG_ELEMENT_STOP (common, ebml, "CueTrackPositions", ret);
|
||||
|
||||
if ((ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
|
||||
if ((ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
|
||||
&& idx.pos != (guint64) - 1 && idx.track > 0) {
|
||||
g_array_append_val (common->index, idx);
|
||||
(*nentries)++;
|
||||
} else if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS) {
|
||||
GST_DEBUG_OBJECT (common, "CueTrackPositions without valid content");
|
||||
}
|
||||
|
||||
|
@ -1571,7 +1571,7 @@ gst_matroska_read_common_peek_adapter (GstMatroskaReadCommon * common, guint
|
|||
/* Caller needs to gst_adapter_unmap. */
|
||||
*data = gst_adapter_map (common->adapter, peek);
|
||||
if (*data == NULL)
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
@ -1661,7 +1661,7 @@ gst_matroska_read_common_peek_bytes (GstMatroskaReadCommon * common, guint64
|
|||
*p_buf = NULL;
|
||||
if (bytes)
|
||||
*bytes = NULL;
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
|
||||
if (p_buf)
|
||||
|
@ -1861,7 +1861,7 @@ gst_matroska_read_common_read_track_encoding (GstMatroskaReadCommon * common,
|
|||
}
|
||||
|
||||
DEBUG_ELEMENT_STOP (common, ebml, "ContentEncoding", ret);
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
|
||||
return ret;
|
||||
|
||||
/* TODO: Check if the combination of values is valid */
|
||||
|
@ -1906,7 +1906,7 @@ gst_matroska_read_common_read_track_encodings (GstMatroskaReadCommon * common,
|
|||
}
|
||||
|
||||
DEBUG_ELEMENT_STOP (common, ebml, "ContentEncodings", ret);
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
|
||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
|
||||
return ret;
|
||||
|
||||
/* Sort encodings according to their order */
|
||||
|
|
|
@ -368,10 +368,10 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
|
|||
if (error != NULL)
|
||||
g_error_free (error);
|
||||
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
} else {
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
} else {
|
||||
goto handle_error;
|
||||
|
|
|
@ -478,7 +478,7 @@ gst_split_file_src_create (GstBaseSrc * basesrc, guint64 offset, guint size,
|
|||
cur_part = src->parts[src->cur_part];
|
||||
if (offset < cur_part.start || offset > cur_part.stop) {
|
||||
if (!gst_split_file_src_find_part_for_offset (src, offset, &src->cur_part))
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
cur_part = src->parts[src->cur_part];
|
||||
}
|
||||
|
||||
|
|
|
@ -629,7 +629,7 @@ nodata:
|
|||
if (G_UNLIKELY (size == MULTIPART_DATA_ERROR))
|
||||
return GST_FLOW_ERROR;
|
||||
if (G_UNLIKELY (size == MULTIPART_DATA_EOS))
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -535,7 +535,7 @@ eos:
|
|||
{
|
||||
GST_DEBUG_OBJECT (mux, "Pushing EOS");
|
||||
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
goto beach;
|
||||
}
|
||||
nego_error:
|
||||
|
|
|
@ -1434,7 +1434,7 @@ out_flushing:
|
|||
}
|
||||
have_eos:
|
||||
{
|
||||
ret = GST_FLOW_UNEXPECTED;
|
||||
ret = GST_FLOW_EOS;
|
||||
GST_WARNING_OBJECT (jitterbuffer, "we are EOS, refusing buffer");
|
||||
gst_buffer_unref (buffer);
|
||||
goto finished;
|
||||
|
@ -1905,7 +1905,7 @@ do_eos:
|
|||
{
|
||||
/* store result, we are flushing now */
|
||||
GST_DEBUG_OBJECT (jitterbuffer, "We are EOS, pushing EOS downstream");
|
||||
priv->srcresult = GST_FLOW_UNEXPECTED;
|
||||
priv->srcresult = GST_FLOW_EOS;
|
||||
gst_pad_pause_task (priv->srcpad);
|
||||
JBUF_UNLOCK (priv);
|
||||
gst_pad_push_event (priv->srcpad, gst_event_new_eos ());
|
||||
|
|
|
@ -3698,7 +3698,7 @@ server_eof:
|
|||
("The server closed the connection."));
|
||||
src->conninfo.connected = FALSE;
|
||||
gst_rtsp_message_unset (&message);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
interrupt:
|
||||
{
|
||||
|
@ -3882,7 +3882,7 @@ server_eof:
|
|||
("The server closed the connection."));
|
||||
src->conninfo.connected = FALSE;
|
||||
gst_rtsp_message_unset (&message);
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4113,7 +4113,7 @@ pause:
|
|||
|
||||
GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
|
||||
src->running = FALSE;
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* perform EOS logic */
|
||||
if (src->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
||||
gst_element_post_message (GST_ELEMENT_CAST (src),
|
||||
|
@ -4122,7 +4122,7 @@ pause:
|
|||
} else {
|
||||
gst_rtspsrc_push_event (src, gst_event_new_eos (), FALSE);
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
/* for fatal errors we post an error message, post the error before the
|
||||
* EOS so the app knows about the error first. */
|
||||
GST_ELEMENT_ERROR (src, STREAM, FAILED,
|
||||
|
|
|
@ -1953,12 +1953,12 @@ iterate_adapter:
|
|||
found_eos:
|
||||
{
|
||||
GST_DEBUG_OBJECT (wav, "found EOS");
|
||||
return GST_FLOW_UNEXPECTED;
|
||||
return GST_FLOW_EOS;
|
||||
}
|
||||
pull_error:
|
||||
{
|
||||
/* check if we got EOS */
|
||||
if (res == GST_FLOW_UNEXPECTED)
|
||||
if (res == GST_FLOW_EOS)
|
||||
goto found_eos;
|
||||
|
||||
GST_WARNING_OBJECT (wav,
|
||||
|
@ -2019,7 +2019,7 @@ pause:
|
|||
GST_DEBUG_OBJECT (wav, "pausing task, reason %s", reason);
|
||||
gst_pad_pause_task (pad);
|
||||
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
if (ret == GST_FLOW_EOS) {
|
||||
/* handle end-of-stream/segment */
|
||||
/* so align our position with the end of it, if there is one
|
||||
* this ensures a subsequent will arrive at correct base/acc time */
|
||||
|
@ -2053,7 +2053,7 @@ pause:
|
|||
} else {
|
||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
|
||||
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
|
||||
/* for fatal errors we post an error message, post the error
|
||||
* first so the app knows about the error first. */
|
||||
GST_ELEMENT_ERROR (wav, STREAM, FAILED,
|
||||
|
|
Loading…
Reference in a new issue