summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-08-08 19:59:11 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-08-10 15:36:47 +0000
commit159562faf720d67f631c47080f852cef5316e377 (patch)
tree70b65417d31858b0637e3403d3b403543cda059a /sys
parentd9dda36e02c82eb91a6b946d9a2a66c71ecef00b (diff)
downloadgstreamer-plugins-bad-159562faf720d67f631c47080f852cef5316e377.tar.gz
va: h264dec: check return value of gst_va_handle_set_context()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1499>
Diffstat (limited to 'sys')
-rw-r--r--sys/va/gstvah264dec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/va/gstvah264dec.c b/sys/va/gstvah264dec.c
index a99a5cb17..1201b7256 100644
--- a/sys/va/gstvah264dec.c
+++ b/sys/va/gstvah264dec.c
@@ -1300,13 +1300,16 @@ gst_va_h264_dec_set_context (GstElement * element, GstContext * context)
GstVaDisplay *old_display, *new_display;
GstVaH264Dec *self = GST_VA_H264_DEC (element);
GstVaH264DecClass *klass = GST_VA_H264_DEC_GET_CLASS (self);
+ gboolean ret;
old_display = self->display ? gst_object_ref (self->display) : NULL;
- gst_va_handle_set_context (element, context, klass->render_device_path,
+ ret = gst_va_handle_set_context (element, context, klass->render_device_path,
&self->display);
new_display = self->display ? gst_object_ref (self->display) : NULL;
- if (old_display && new_display && old_display != new_display && self->decoder) {
+ if (!ret
+ || (old_display && new_display && old_display != new_display
+ && self->decoder)) {
GST_ELEMENT_WARNING (element, RESOURCE, BUSY,
("Can't replace VA display while operating"), (NULL));
}