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 <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=750835
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);
}