audiodecoder: Remove pointless else{} around some code
This commit is contained in:
parent
7c0f885ad2
commit
c35e3e7c7d
@ -1443,40 +1443,39 @@ 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 {
|
|
||||||
/* Send any pending events before draining, as that
|
|
||||||
* may update the pending segment info */
|
|
||||||
send_pending_events (dec);
|
|
||||||
/* dispatch reverse pending buffers */
|
|
||||||
/* chain eventually calls upon drain as well, but by that time
|
|
||||||
* gather list should be clear, so ok ... */
|
|
||||||
if (dec->output_segment.rate < 0.0 && dec->priv->gather)
|
|
||||||
gst_audio_decoder_chain_reverse (dec, NULL);
|
|
||||||
/* have subclass give all it can */
|
|
||||||
ret = gst_audio_decoder_push_buffers (dec, TRUE);
|
|
||||||
if (ret != GST_FLOW_OK) {
|
|
||||||
GST_WARNING_OBJECT (dec, "audio decoder push buffers failed");
|
|
||||||
goto drain_failed;
|
|
||||||
}
|
|
||||||
/* ensure all output sent */
|
|
||||||
ret = gst_audio_decoder_output (dec, NULL);
|
|
||||||
if (ret != GST_FLOW_OK)
|
|
||||||
GST_WARNING_OBJECT (dec, "audio decoder output failed");
|
|
||||||
|
|
||||||
drain_failed:
|
/* Send any pending events before draining, as that
|
||||||
/* everything should be away now */
|
* may update the pending segment info */
|
||||||
if (dec->priv->frames.length) {
|
send_pending_events (dec);
|
||||||
/* not fatal/impossible though if subclass/codec eats stuff */
|
/* dispatch reverse pending buffers */
|
||||||
GST_WARNING_OBJECT (dec, "still %d frames left after draining",
|
/* chain eventually calls upon drain as well, but by that time
|
||||||
dec->priv->frames.length);
|
* gather list should be clear, so ok ... */
|
||||||
g_queue_foreach (&dec->priv->frames, (GFunc) gst_buffer_unref, NULL);
|
if (dec->output_segment.rate < 0.0 && dec->priv->gather)
|
||||||
g_queue_clear (&dec->priv->frames);
|
gst_audio_decoder_chain_reverse (dec, NULL);
|
||||||
}
|
/* have subclass give all it can */
|
||||||
|
ret = gst_audio_decoder_push_buffers (dec, TRUE);
|
||||||
/* discard (unparsed) leftover */
|
if (ret != GST_FLOW_OK) {
|
||||||
gst_adapter_clear (dec->priv->adapter);
|
GST_WARNING_OBJECT (dec, "audio decoder push buffers failed");
|
||||||
return ret;
|
goto drain_failed;
|
||||||
}
|
}
|
||||||
|
/* ensure all output sent */
|
||||||
|
ret = gst_audio_decoder_output (dec, NULL);
|
||||||
|
if (ret != GST_FLOW_OK)
|
||||||
|
GST_WARNING_OBJECT (dec, "audio decoder output failed");
|
||||||
|
|
||||||
|
drain_failed:
|
||||||
|
/* everything should be away now */
|
||||||
|
if (dec->priv->frames.length) {
|
||||||
|
/* not fatal/impossible though if subclass/codec eats stuff */
|
||||||
|
GST_WARNING_OBJECT (dec, "still %d frames left after draining",
|
||||||
|
dec->priv->frames.length);
|
||||||
|
g_queue_foreach (&dec->priv->frames, (GFunc) gst_buffer_unref, NULL);
|
||||||
|
g_queue_clear (&dec->priv->frames);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* discard (unparsed) leftover */
|
||||||
|
gst_adapter_clear (dec->priv->adapter);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hard == FLUSH, otherwise discont */
|
/* hard == FLUSH, otherwise discont */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user