update for UNEXPECTED -> EOS flowreturn

This commit is contained in:
Wim Taymans 2011-10-10 11:39:52 +02:00
parent 123671bc05
commit f1088ed647
15 changed files with 39 additions and 39 deletions

View file

@ -399,7 +399,7 @@ gst_gio_base_src_create (GstBaseSrc * base_src, guint64 offset, guint size,
}
if (eos)
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
}
*buf_return = buf;

View file

@ -1073,7 +1073,7 @@ gst_ogg_pad_stream_out (GstOggPad * pad, gint npackets)
* 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:
@ -2077,7 +2077,7 @@ boundary_reached:
eos:
{
GST_LOG_OBJECT (ogg, "reached EOS");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
error:
{
@ -2094,7 +2094,7 @@ 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.
@ -2208,7 +2208,7 @@ gst_ogg_demux_get_prev_page (GstOggDemux * ogg, ogg_page * og, gint64 * offset)
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) {
@ -3336,7 +3336,7 @@ gst_ogg_demux_bisect_forward_serialno (GstOggDemux * ogg,
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);
@ -3362,7 +3362,7 @@ gst_ogg_demux_bisect_forward_serialno (GstOggDemux * ogg,
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");
@ -3412,7 +3412,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_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);
@ -3425,7 +3425,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
* 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;
}
@ -3450,7 +3450,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain)
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");
@ -4054,7 +4054,7 @@ gst_ogg_demux_loop_forward (GstOggDemux * ogg)
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;
}
@ -4081,7 +4081,7 @@ gst_ogg_demux_loop_forward (GstOggDemux * ogg)
/* 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:
@ -4106,7 +4106,7 @@ gst_ogg_demux_loop_reverse (GstOggDemux * ogg)
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;
}
@ -4129,7 +4129,7 @@ gst_ogg_demux_loop_reverse (GstOggDemux * ogg)
/* 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:
@ -4251,7 +4251,7 @@ pause:
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;
@ -4274,7 +4274,7 @@ pause:
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));

View file

@ -1885,7 +1885,7 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux)
if (best->eos && all_pads_eos (pads)) {
gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ());
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
return ret;

View file

@ -2351,7 +2351,7 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstBuffer * buffer)
if (overlay->text_eos) {
GST_OBJECT_UNLOCK (overlay);
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
GST_LOG_OBJECT (overlay, "text EOS");
goto beach;
}
@ -2718,7 +2718,7 @@ have_eos:
GST_OBJECT_UNLOCK (overlay);
GST_DEBUG_OBJECT (overlay, "eos, discarding buffer");
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
out_of_segment:
{

View file

@ -1020,7 +1020,7 @@ eos:
g_mutex_unlock (priv->mutex);
if (caps)
gst_caps_unref (caps);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
seek_error:
{
@ -1474,7 +1474,7 @@ eos:
if (steal_ref)
gst_buffer_unref (buffer);
g_mutex_unlock (priv->mutex);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -1491,7 +1491,7 @@ eos:
*
* Returns: #GST_FLOW_OK when the buffer was successfuly queued.
* #GST_FLOW_WRONG_STATE when @appsrc is not PAUSED or PLAYING.
* #GST_FLOW_UNEXPECTED when EOS occured.
* #GST_FLOW_EOS when EOS occured.
*
* Since: 0.10.22
*/

View file

@ -580,7 +580,7 @@ gst_audio_decoder_setup (GstAudioDecoder * dec)
gst_query_unref (query);
/* normalize to bool */
dec->priv->agg = !!res;
dec->priv->agg = ! !res;
}
/* mini aggregator combining output buffers into fewer larger ones,
@ -971,7 +971,7 @@ gst_audio_decoder_push_buffers (GstAudioDecoder * dec, gboolean force)
goto parse_failed;
}
if (ret == GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_EOS) {
GST_LOG_OBJECT (dec, "no frame yet");
ret = GST_FLOW_OK;
break;

View file

@ -1804,7 +1804,7 @@ gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
&buf);
if (ret != GST_FLOW_OK) {
if (ret == GST_FLOW_UNEXPECTED)
if (ret == GST_FLOW_EOS)
goto eos;
else
goto error;

View file

@ -1579,7 +1579,7 @@ gst_cdda_base_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
GST_DEBUG_OBJECT (src, "EOS at sector %d, cur_track=%d, mode=%d",
src->cur_sector, src->cur_track, src->mode);
/* base class will send EOS for us */
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
if (src->prev_track != src->cur_track) {

View file

@ -101,11 +101,11 @@ skip_junk:
/* ERRORS */
too_small:
{
/* short read, we return UNEXPECTED to mark the EOS case */
/* short read, we return EOS to mark the EOS case */
GST_DEBUG_OBJECT (element, "not enough data (available=%" G_GSIZE_FORMAT
", needed=%u)", gst_buffer_get_size (buf), size);
gst_buffer_unref (buf);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -626,7 +626,7 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf)
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 */
@ -677,7 +677,7 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf)
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)) {
@ -1305,7 +1305,7 @@ gst_tag_demux_read_range (GstTagDemux * demux,
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;
@ -1330,7 +1330,7 @@ read_beyond_end:
gst_buffer_unref (*buffer);
*buffer = NULL;
}
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -1244,7 +1244,7 @@ eos:
{
GST_DEBUG_OBJECT (adder, "no data available, must be EOS");
gst_pad_push_event (adder->srcpad, gst_event_new_eos ());
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -1119,7 +1119,7 @@ gst_audio_test_src_fill (GstBaseSrc * basesrc, guint64 offset,
if (src->eos_reached) {
GST_INFO_OBJECT (src, "eos");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
samplerate = GST_AUDIO_INFO_RATE (&src->info);

View file

@ -1451,11 +1451,11 @@ handle_buffer (GstSubParse * self, GstBuffer * buf)
/* make sure we know the format */
if (G_UNLIKELY (self->parser_type == GST_SUB_PARSE_FORMAT_UNKNOWN)) {
if (!(caps = gst_sub_parse_format_autodetect (self))) {
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
if (!gst_pad_set_caps (self->srcpad, caps)) {
gst_caps_unref (caps);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
gst_caps_unref (caps);

View file

@ -189,7 +189,7 @@ ioctl_error:
got_eos:
{
GST_DEBUG_OBJECT (this, "Got EOS on socket stream");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
read_error:
{
@ -288,7 +288,7 @@ ioctl_error:
got_eos:
{
GST_DEBUG_OBJECT (this, "Got EOS on socket stream");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
read_error:
{

View file

@ -829,7 +829,7 @@ not_negotiated:
eos:
{
GST_DEBUG_OBJECT (src, "eos: 0 framerate, frame %d", (gint) src->n_frames);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
invalid_frame:
{