Revert "audiodecoder: Error out earlier in a few places if something goes wrong"

This reverts commit eb68a2d5a7e4e9598df6eb812589c092fe2cc89a.

This sometimes errors out too early now, needs some more thoughts.
This commit is contained in:
Sebastian Dröge 2012-06-04 10:01:42 +02:00
parent f609b3a627
commit 2667d4bb82

View File

@ -772,12 +772,9 @@ again:
} }
if (inbuf) { if (inbuf) {
if (ret == GST_FLOW_OK) {
buf = inbuf; buf = inbuf;
goto again; goto again;
} }
gst_buffer_unref (inbuf);
}
} }
return ret; return ret;
@ -1053,6 +1050,7 @@ gst_audio_decoder_push_buffers (GstAudioDecoder * dec, gboolean force)
GST_DEBUG_OBJECT (dec, "available: %d", av); GST_DEBUG_OBJECT (dec, "available: %d", av);
while (ret == GST_FLOW_OK) { while (ret == GST_FLOW_OK) {
flush = 0; flush = 0;
ctx->eos = force; ctx->eos = force;
@ -1152,21 +1150,15 @@ gst_audio_decoder_drain (GstAudioDecoder * dec)
if (dec->priv->drained && !dec->priv->gather) if (dec->priv->drained && !dec->priv->gather)
return GST_FLOW_OK; return GST_FLOW_OK;
else { else {
GstFlowReturn ret2;
/* dispatch reverse pending buffers */ /* dispatch reverse pending buffers */
/* chain eventually calls upon drain as well, but by that time /* chain eventually calls upon drain as well, but by that time
* gather list should be clear, so ok ... */ * gather list should be clear, so ok ... */
if (dec->output_segment.rate < 0.0 && dec->priv->gather) if (dec->output_segment.rate < 0.0 && dec->priv->gather)
gst_audio_decoder_chain_reverse (dec, NULL); gst_audio_decoder_chain_reverse (dec, NULL);
/* have subclass give all it can, if this fails we /* have subclass give all it can */
* still want the subclass to output everything it ret = gst_audio_decoder_push_buffers (dec, TRUE);
* can but we will return the error from here */
ret2 = gst_audio_decoder_push_buffers (dec, TRUE);
/* ensure all output sent */ /* ensure all output sent */
ret = gst_audio_decoder_output (dec, NULL); ret = gst_audio_decoder_output (dec, NULL);
if (ret2 != GST_FLOW_OK)
ret = ret2;
/* everything should be away now */ /* everything should be away now */
if (dec->priv->frames.length) { if (dec->priv->frames.length) {
/* not fatal/impossible though if subclass/codec eats stuff */ /* not fatal/impossible though if subclass/codec eats stuff */
@ -1342,8 +1334,6 @@ gst_audio_decoder_flush_decode (GstAudioDecoder * dec)
/* decode buffer, resulting data prepended to output queue */ /* decode buffer, resulting data prepended to output queue */
gst_buffer_ref (buf); gst_buffer_ref (buf);
res = gst_audio_decoder_chain_forward (dec, buf); res = gst_audio_decoder_chain_forward (dec, buf);
if (res != GST_FLOW_OK)
return res;
/* if we generated output, we can discard the buffer, else we /* if we generated output, we can discard the buffer, else we
* keep it in the queue */ * keep it in the queue */