mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
buffer: add guard to buffer_set_caps() that checks if caps are simple
This commit is contained in:
parent
a09bd97bc6
commit
59209b1891
1 changed files with 3 additions and 0 deletions
|
@ -485,9 +485,12 @@ void
|
||||||
gst_buffer_set_caps (GstBuffer * buffer, GstCaps * caps)
|
gst_buffer_set_caps (GstBuffer * buffer, GstCaps * caps)
|
||||||
{
|
{
|
||||||
g_return_if_fail (buffer != NULL);
|
g_return_if_fail (buffer != NULL);
|
||||||
|
g_return_if_fail (caps == NULL || GST_CAPS_IS_SIMPLE (caps));
|
||||||
|
|
||||||
#if GST_VERSION_NANO == 1
|
#if GST_VERSION_NANO == 1
|
||||||
/* we enable this extra debugging in git versions only for now */
|
/* we enable this extra debugging in git versions only for now */
|
||||||
g_warn_if_fail (gst_buffer_is_metadata_writable (buffer));
|
g_warn_if_fail (gst_buffer_is_metadata_writable (buffer));
|
||||||
|
/* FIXME: would be nice to also check if caps are fixed here, but expensive */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_caps_replace (&GST_BUFFER_CAPS (buffer), caps);
|
gst_caps_replace (&GST_BUFFER_CAPS (buffer), caps);
|
||||||
|
|
Loading…
Reference in a new issue