* collecting headers and that we don't have exposed the pads yet */
if (result == GST_FLOW_NOT_LINKED)
break;
- else if (result <= GST_FLOW_UNEXPECTED)
+ else if (result <= GST_FLOW_EOS)
goto could_not_submit;
break;
default:
eos:
{
GST_LOG_OBJECT (ogg, "reached EOS");
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
error:
{
* @offset will contain the offset the next page starts at when this function
* returns GST_FLOW_OK.
*
- * GST_FLOW_UNEXPECTED is returned on EOS.
+ * GST_FLOW_EOS is returned on EOS.
*
* GST_FLOW_LIMIT is returned when we did not find a page before the
* boundary. If @boundary is -1, this is never returned.
break;
}
/* something went wrong */
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
new_offset = 0;
GST_LOG_OBJECT (ogg, "got unexpected");
} else if (ret != GST_FLOW_OK) {
gst_ogg_demux_seek (ogg, bisect);
ret = gst_ogg_demux_get_next_page (ogg, &og, -1, &offset);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
endsearched = bisect;
} else if (ret == GST_FLOW_OK) {
guint32 serial = ogg_page_serialno (&og);
gst_ogg_demux_seek (ogg, next);
ret = gst_ogg_demux_read_chain (ogg, &nextchain);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
nextchain = NULL;
ret = GST_FLOW_OK;
GST_LOG_OBJECT (ogg, "no next chain");
ret = gst_ogg_demux_get_next_page (ogg, &og, -1, NULL);
if (ret != GST_FLOW_OK) {
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (ogg, "Reached EOS, done reading end chain");
} else {
GST_WARNING_OBJECT (ogg, "problem reading BOS page: ret=%d", ret);
* ignore it */
if (!chain) {
GST_WARNING_OBJECT (ogg, "No chain found, no Ogg data in stream ?");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
}
break;
}
if (ret == GST_FLOW_OK) {
GST_WARNING_OBJECT (ogg, "no chain was found");
ret = GST_FLOW_ERROR;
- } else if (ret != GST_FLOW_UNEXPECTED) {
+ } else if (ret != GST_FLOW_EOS) {
GST_WARNING_OBJECT (ogg, "failed to read chain");
} else {
GST_DEBUG_OBJECT (ogg, "done reading chains");
if (ogg->offset == ogg->length) {
GST_LOG_OBJECT (ogg, "no more data to pull %" G_GINT64_FORMAT
" == %" G_GINT64_FORMAT, ogg->offset, ogg->length);
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
/* check for the end of the segment */
if (gst_ogg_demux_check_eos (ogg)) {
GST_LOG_OBJECT (ogg, "got EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
done:
if (ogg->offset == 0) {
GST_LOG_OBJECT (ogg, "no more data to pull %" G_GINT64_FORMAT
" == 0", ogg->offset);
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
/* check for the end of the segment */
if (gst_ogg_demux_check_eos (ogg)) {
GST_LOG_OBJECT (ogg, "got EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
done:
GST_LOG_OBJECT (ogg, "pausing task, reason %s", reason);
gst_pad_pause_task (ogg->sinkpad);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* perform EOS logic */
if (ogg->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gint64 stop;
GST_LOG_OBJECT (ogg, "Sending EOS, at end of stream");
event = 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 (ogg, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s", reason));
typefind_buf = demux->priv->collect;
gst_buffer_ref (typefind_buf);
if (!gst_tag_demux_trim_buffer (demux, &typefind_buf, &typefind_size))
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
if (typefind_buf == NULL)
break; /* Still need more data */
demux->priv->collect = NULL;
demux->priv->collect_size = 0;
if (!gst_tag_demux_trim_buffer (demux, &outbuf, &outbuf_size))
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
if (outbuf) {
if (G_UNLIKELY (demux->priv->srcpad == NULL)) {
if (in_offset + length >= demux->priv->upstream_size - demux->priv->strip_end) {
if (in_offset + demux->priv->strip_end >= demux->priv->upstream_size)
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
in_length = demux->priv->upstream_size - demux->priv->strip_end - in_offset;
} else {
in_length = length;
gst_buffer_unref (*buffer);
*buffer = NULL;
}
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
}