diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-06-19 11:12:47 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-06-19 18:34:05 +0200 |
commit | 71c0e0e19feea20d7262d50438952b2ceef3c544 (patch) | |
tree | 8167af679255e446c22c2864a97043e35232f1f4 /sys/androidmedia/gstamcaudiodec.c | |
parent | e3af42ae82f717cdbe7c17bec8953852ffec1cfc (diff) | |
download | gstreamer-plugins-bad-71c0e0e19feea20d7262d50438952b2ceef3c544.tar.gz |
androidmedia: Clean up flushing code and don't consider output buffer releasing failures during flushing as an error
Diffstat (limited to 'sys/androidmedia/gstamcaudiodec.c')
-rw-r--r-- | sys/androidmedia/gstamcaudiodec.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index fa67e0680..9d9f4ff4b 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -562,8 +562,13 @@ retry: } done: - if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err)) + if (!gst_amc_codec_release_output_buffer (self->codec, idx, &err)) { + if (self->flushing) { + g_clear_error (&err); + goto flushing; + } goto failed_release; + } if (is_eos || flow_ret == GST_FLOW_EOS) { GST_AUDIO_DECODER_STREAM_UNLOCK (self); @@ -1054,7 +1059,7 @@ gst_amc_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf) GST_AUDIO_DECODER_STREAM_LOCK (self); if (idx < 0) { - if (self->flushing) { + if (self->flushing || self->downstream_flow_ret == GST_FLOW_FLUSHING) { g_clear_error (&err); goto flushing; } @@ -1078,8 +1083,11 @@ gst_amc_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf) if (idx >= self->n_input_buffers) goto invalid_buffer_index; - if (self->flushing) + if (self->flushing) { + memset (&buffer_info, 0, sizeof (buffer_info)); + gst_amc_codec_queue_input_buffer (self->codec, idx, &buffer_info, NULL); goto flushing; + } if (self->downstream_flow_ret != GST_FLOW_OK) { memset (&buffer_info, 0, sizeof (buffer_info)); |