mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
va: h264dec: check return value of gst_va_handle_set_context()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1499>
This commit is contained in:
parent
d9dda36e02
commit
159562faf7
1 changed files with 5 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue