va: decoder: render picture only if data

Call vaRenderPicture() only if buffer or slice data is available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1584>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-09-19 14:08:46 +02:00
parent ad019a1d01
commit 467618f8ac

View file

@ -586,22 +586,26 @@ gst_va_decoder_decode (GstVaDecoder * self, GstVaDecodePicture * pic)
goto fail_end_pic; goto fail_end_pic;
} }
gst_va_display_lock (self->display); if (pic->buffers->len > 0) {
status = vaRenderPicture (dpy, self->context, gst_va_display_lock (self->display);
(VABufferID *) pic->buffers->data, pic->buffers->len); status = vaRenderPicture (dpy, self->context,
gst_va_display_unlock (self->display); (VABufferID *) pic->buffers->data, pic->buffers->len);
if (status != VA_STATUS_SUCCESS) { gst_va_display_unlock (self->display);
GST_WARNING_OBJECT (self, "vaRenderPicture: %s", vaErrorStr (status)); if (status != VA_STATUS_SUCCESS) {
goto fail_end_pic; GST_WARNING_OBJECT (self, "vaRenderPicture: %s", vaErrorStr (status));
goto fail_end_pic;
}
} }
gst_va_display_lock (self->display); if (pic->slices->len > 0) {
status = vaRenderPicture (dpy, self->context, gst_va_display_lock (self->display);
(VABufferID *) pic->slices->data, pic->slices->len); status = vaRenderPicture (dpy, self->context,
gst_va_display_unlock (self->display); (VABufferID *) pic->slices->data, pic->slices->len);
if (status != VA_STATUS_SUCCESS) { gst_va_display_unlock (self->display);
GST_WARNING_OBJECT (self, "vaRenderPicture: %s", vaErrorStr (status)); if (status != VA_STATUS_SUCCESS) {
goto fail_end_pic; GST_WARNING_OBJECT (self, "vaRenderPicture: %s", vaErrorStr (status));
goto fail_end_pic;
}
} }
gst_va_display_lock (self->display); gst_va_display_lock (self->display);