video: init chroma-size and colorimetry members even if missing from caps
authorRené Stadler <rene.stadler@collabora.co.uk>
Fri, 11 Nov 2011 18:53:11 +0000 (19:53 +0100)
committerRené Stadler <rene.stadler@collabora.co.uk>
Fri, 11 Nov 2011 18:57:25 +0000 (19:57 +0100)
This makes a TRUE return from gst_video_info_from_caps fully consistent with
gst_video_info_init.

gst-libs/gst/video/video.c

index 1ec4d53..8ce97cc 100644 (file)
@@ -854,9 +854,13 @@ gst_video_info_from_caps (GstVideoInfo * info, const GstCaps * caps)
 
   if ((s = gst_structure_get_string (structure, "chroma-site")))
     info->chroma_site = gst_video_chroma_from_string (s);
+  else
+    info->chroma_site = GST_VIDEO_CHROMA_SITE_UNKNOWN;
 
   if ((s = gst_structure_get_string (structure, "colorimetry")))
     gst_video_colorimetry_from_string (&info->colorimetry, s);
+  else
+    memset (&info->colorimetry, 0, sizeof (GstVideoColorimetry));
 
   if (gst_structure_get_fraction (structure, "pixel-aspect-ratio",
           &par_n, &par_d)) {