From cf572ae2cb920bc6851749df2b46523fd1e3de93 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 9 Mar 2015 15:58:50 +0100 Subject: [PATCH] video-info: use default colorimetry on error When we fail to parse the colorimetry property, fall back to the default colorimetry for the format and dimension instead of leaving things undefined. --- gst-libs/gst/video/video-info.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index c8e2038..9686e83 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -243,9 +243,10 @@ gst_video_info_from_caps (GstVideoInfo * info, const GstCaps * caps) 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 + if ((s = gst_structure_get_string (structure, "colorimetry"))) { + if (!gst_video_colorimetry_from_string (&info->colorimetry, s)) + set_default_colorimetry (info); + } else set_default_colorimetry (info); if (gst_structure_get_fraction (structure, "pixel-aspect-ratio", -- 2.7.4