diff options
author | Sanjay NM <sanjay.nm@samsung.com> | 2014-12-10 16:10:58 +0530 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-06-10 19:27:23 +0100 |
commit | d6e351cf8a3400a2f0b391263a624306e56b3045 (patch) | |
tree | c1860c6929c2e24e2c203d3e4583a7c88a45a234 | |
parent | 05b82fe0f9898916fab8c1fa60c50f4f27e01da2 (diff) |
audio: Add error handling to gst_audio_decoder_drain()
https://bugzilla.gnome.org/show_bug.cgi?id=740686
-rw-r--r-- | gst-libs/gst/audio/gstaudiodecoder.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index fca1abd0c..28a217dc3 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1450,8 +1450,16 @@ gst_audio_decoder_drain (GstAudioDecoder * dec) 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: /* everything should be away now */ if (dec->priv->frames.length) { /* not fatal/impossible though if subclass/codec eats stuff */ @@ -1460,9 +1468,9 @@ gst_audio_decoder_drain (GstAudioDecoder * dec) 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; } } |