gstreamer: structure: Don't print warning on NULL strings or pointers

Nicolas Dufresne nicolas at ndufresne.ca
Fri Apr 7 00:32:06 UTC 2017


Le jeudi 06 avril 2017 à 23:25 +0000, Olivier Crête a écrit :
> Module: gstreamer
> Branch: master
> Commit: 0b9eb621b69b06df350ba25cb3a07ad9d23aef88
> URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=0b
> 9eb621b69b06df350ba25cb3a07ad9d23aef88
> 
> Author: Olivier Crête <olivier.crete at collabora.com>
> Date:   Wed Mar  8 12:09:45 2017 -0500
> 
> structure: Don't print warning on NULL strings or pointers
> 
> Putting NULL for those is a valid serialization for the NULL value.

I think this warning was on purpose because you will not be able to
serialize it later. I would opt on a revert and further discussion
about this one.

> 
> ---
> 
>  gst/gststructure.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/gst/gststructure.c b/gst/gststructure.c
> index 5be496bfb..8596c2bce 100644
> --- a/gst/gststructure.c
> +++ b/gst/gststructure.c
> @@ -1823,9 +1823,12 @@ priv_gst_structure_append_to_gstring (const
> GstStructure * structure,
>        g_string_append (s, t);
>        g_free (t);
>      } else {
> -      GST_WARNING ("No value transform to serialize field '%s' of
> type '%s'",
> -          g_quark_to_string (field->name),
> -          _priv_gst_value_gtype_to_abbr (type));
> +      if (!G_TYPE_CHECK_VALUE_TYPE (&field->value, G_TYPE_STRING) &&
> +          !(G_TYPE_CHECK_VALUE_TYPE (&field->value, G_TYPE_POINTER)
> &&
> +              g_value_get_pointer (&field->value) == NULL))
> +        GST_WARNING ("No value transform to serialize field '%s' of
> type '%s'",
> +            g_quark_to_string (field->name),
> +            _priv_gst_value_gtype_to_abbr (type));
>        g_string_append (s, "NULL");
>      }
>    }
> 
> _______________________________________________
> gstreamer-commits mailing list
> gstreamer-commits at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170406/ace65c1e/attachment-0001.sig>


More information about the gstreamer-devel mailing list