From 4ff4563a471e3a0a089648a539084ee220483e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 11 Aug 2014 17:14:53 +0300 Subject: [PATCH] vaapidecode: don't try flushing the decoder instance if we didn't create one yet This otherwise results in unnecessary error messages. https://bugzilla.gnome.org/show_bug.cgi?id=734616 --- gst/vaapi/gstvaapidecode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 3891729e9a..11951d469f 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -463,6 +463,9 @@ gst_vaapidecode_flush(GstVideoDecoder *vdec) GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec); GstVaapiDecoderStatus status; + if (!decode->decoder) + return TRUE; + /* If there is something in GstVideoDecoder's output adapter, then submit the frame for decoding */ if (decode->current_frame_size) { @@ -489,6 +492,9 @@ gst_vaapidecode_finish(GstVideoDecoder *vdec) GstVaapiDecode * const decode = GST_VAAPIDECODE(vdec); GstFlowReturn ret = GST_FLOW_OK; + if (!decode->decoder) + return GST_FLOW_OK; + if (!gst_vaapidecode_flush(vdec)) ret = GST_FLOW_OK;