mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-15 04:46:32 +00:00
registry: avoid copy when caps are fixed
Avoid doing a useless copy when the caps are fixed and simplify will not do anything.
This commit is contained in:
parent
6ffba69d65
commit
6426145fc9
1 changed files with 8 additions and 5 deletions
|
@ -323,11 +323,14 @@ gst_registry_chunks_save_feature (GList ** list, GstPluginFeature * feature)
|
||||||
if (factory->caps) {
|
if (factory->caps) {
|
||||||
/* we copy the caps here so we can simplify them before saving. This
|
/* we copy the caps here so we can simplify them before saving. This
|
||||||
* is a lot faster when loading them later on */
|
* is a lot faster when loading them later on */
|
||||||
GstCaps *copy = gst_caps_copy (factory->caps);
|
if (!gst_caps_is_fixed (factory->caps)) {
|
||||||
|
GstCaps *copy = gst_caps_copy (factory->caps);
|
||||||
gst_caps_do_simplify (copy);
|
gst_caps_do_simplify (copy);
|
||||||
str = gst_caps_to_string (copy);
|
str = gst_caps_to_string (copy);
|
||||||
gst_caps_unref (copy);
|
gst_caps_unref (copy);
|
||||||
|
} else {
|
||||||
|
str = gst_caps_to_string (factory->caps);
|
||||||
|
}
|
||||||
gst_registry_chunks_save_string (list, str);
|
gst_registry_chunks_save_string (list, str);
|
||||||
} else {
|
} else {
|
||||||
gst_registry_chunks_save_const_string (list, "");
|
gst_registry_chunks_save_const_string (list, "");
|
||||||
|
|
Loading…
Reference in a new issue