summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-03-09 14:58:50 (GMT)
committerWim Taymans <wtaymans@redhat.com>2015-03-09 15:02:17 (GMT)
commitcf572ae2cb920bc6851749df2b46523fd1e3de93 (patch)
tree339676ad39bcf760bc6203213537e3a905e8e710
parentfedc1dba1a2119c0288b37344673c64404bdbabb (diff)
downloadgst-plugins-base-cf572ae2cb920bc6851749df2b46523fd1e3de93.tar.gz
gst-plugins-base-cf572ae2cb920bc6851749df2b46523fd1e3de93.tar.xz
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.
-rw-r--r--gst-libs/gst/video/video-info.c7
1 files 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",