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
This commit is contained in:
Sebastian Dröge 2014-08-11 17:14:53 +03:00 committed by Gwenole Beauchesne
parent 7ac501d026
commit 4ff4563a47

View file

@ -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;