From cb0ec6b60c647cd3c01fe8d8c50a2fb81acf73eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Sun, 10 Jul 2016 19:01:17 +0200 Subject: [PATCH] vaapidecode: remove gst_vaapidecode_internal_flush() As gst_vaapidecode_finish() is the only callee of gst_vaapidecode_internal_flush(), it is better to inline it. https://bugzilla.gnome.org/show_bug.cgi?id=768652 --- gst/vaapi/gstvaapidecode.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index a5ad73165b..83dff65284 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -707,40 +707,29 @@ gst_vaapidecode_drain (GstVideoDecoder * vdec) return gst_vaapidecode_push_all_decoded_frames (decode); } -static gboolean -gst_vaapidecode_internal_flush (GstVideoDecoder * vdec) -{ - GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec); - GstVaapiDecoderStatus status; - - if (!decode->decoder) - return TRUE; - - gst_vaapidecode_flush_output_adapter (decode); - status = gst_vaapi_decoder_flush (decode->decoder); - if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) { - GST_WARNING_OBJECT (decode, "failed to flush decoder (status %d)", status); - return FALSE; - } - - return TRUE; -} - static GstFlowReturn gst_vaapidecode_finish (GstVideoDecoder * vdec) { GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec); - gboolean flushed; + GstVaapiDecoderStatus status; GstFlowReturn ret; if (!decode->decoder) return GST_FLOW_OK; - flushed = gst_vaapidecode_internal_flush (vdec); + gst_vaapidecode_flush_output_adapter (decode); + status = gst_vaapi_decoder_flush (decode->decoder); ret = gst_vaapidecode_push_all_decoded_frames (decode); - if (!flushed) - return GST_FLOW_ERROR; + if (status != GST_VAAPI_DECODER_STATUS_SUCCESS) + goto error_decoder_flush; return ret; + + /* ERRORS: */ +error_decoder_flush: + { + GST_WARNING_OBJECT (decode, "failed to flush decoder (status %d)", status); + return GST_FLOW_ERROR; + } } static gboolean