From: Sanchayan Maity Date: Thu, 26 Nov 2020 13:53:11 +0000 (+0530) Subject: fdkaacdec: Do not report decoding error for flush request X-Git-Tag: 1.22.0~652 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a63d8ee72061ac8ab1707143d106ffa9525cb4d7;p=platform%2Fupstream%2Fgstreamer.git fdkaacdec: Do not report decoding error for flush request A flush request is done when set_format is called to empty internal bit buffer maintained by fdk-aac. When this happens, during the explicit call to handle_buffer, decodeFrame does not return a AAC_DEC_OK. This gets reported as a decoding error while no decoding error in fact took place. Since this can be confusing, just return a GST_FLOW_OK and log that an explicit flush was requested. --- diff --git a/subprojects/gst-plugins-bad/ext/fdkaac/gstfdkaacdec.c b/subprojects/gst-plugins-bad/ext/fdkaac/gstfdkaacdec.c index 8f18cb5..8924b81 100644 --- a/subprojects/gst-plugins-bad/ext/fdkaac/gstfdkaacdec.c +++ b/subprojects/gst-plugins-bad/ext/fdkaac/gstfdkaacdec.c @@ -585,6 +585,15 @@ gst_fdkaacdec_handle_frame (GstAudioDecoder * dec, GstBuffer * inbuf) ret = GST_FLOW_OK; outbuf = NULL; goto finish; + } else if ((err != AAC_DEC_OK) && (flags & AACDEC_FLUSH)) { + /* + * A flush/drain was requested when set_format got called. When a flush + * gets requested, aacDecoder_DecodeFrame may not return AAC_DEC_OK. Do + * not report a decoding error with GST_AUDIO_DECODER_ERROR for this case. + */ + GST_LOG_OBJECT (self, "Decoder flush was requested"); + ret = GST_FLOW_OK; + goto out; } else if (err != AAC_DEC_OK) { GST_AUDIO_DECODER_ERROR (self, 1, STREAM, DECODE, (NULL), ("decoding error: %d", err), ret);