- gst_structure_fixate_field_string (s, "encoding-name", "VP9");
- encoding_name = g_strdup (gst_structure_get_string (s, "encoding-name"));
- gst_caps_unref (src_caps);
- } else {
- encoding_name = g_strdup ("VP9-DRAFT-IETF-01");
+
+ if (gst_structure_has_field (s, "encoding-name")) {
+ GValue default_value = G_VALUE_INIT;
+
+ g_value_init (&default_value, G_TYPE_STRING);
+ g_value_set_static_string (&default_value, encoding_name);
+
+ value = gst_structure_get_value (s, "encoding-name");
+ if (!gst_value_can_intersect (&default_value, value))
+ encoding_name = "VP9-DRAFT-IETF-01";
+ }