From 32d1c5adff4c478a2b7aab0dc9a87de4839cd03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Sat, 29 Aug 2015 00:27:05 +0300 Subject: [PATCH] vaapidecode: renegotiate if caps are not equal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of gst_caps_is_always_compatible() for this optimization may lead to false positives. It is better to stick to gst_caps_is_strictly_equal() to know if it is required a re-negotiation. Signed-off-by: Víctor Manuel Jáquez Leal https://bugzilla.gnome.org/show_bug.cgi?id=750835 --- gst/vaapi/gstvaapidecode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index e0378b523a..07e8a8bd67 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -176,8 +176,13 @@ gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode, if (decode->input_state) { if (new_state) { const GstCaps *curcaps = decode->input_state->caps; - if (gst_caps_is_always_compatible (curcaps, new_state->caps)) + /* If existing caps are equal of the new state, keep the + * existing state without renegotiating. */ + if (gst_caps_is_strictly_equal (curcaps, new_state->caps)) { + GST_DEBUG ("Ignoring new caps %" GST_PTR_FORMAT + " since are equal to current ones", new_state->caps); return FALSE; + } } gst_video_codec_state_unref (decode->input_state); }