video-info: parse field-order for all interleaved formats
authorMarco Felsch <m.felsch@pengutronix.de>
Mon, 19 Nov 2018 16:19:33 +0000 (17:19 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 19 Sep 2019 12:48:48 +0000 (13:48 +0100)
The "field-order" is related for all interlace_mode modes except the
"progressive" mode. So instead of or'ing each mode we can use the
already supported GST_VIDEO_INFO_IS_INTERLACED macro.

gst-libs/gst/video/video-info.c

index ed10887..7aed055 100644 (file)
@@ -473,8 +473,7 @@ gst_video_info_from_caps (GstVideoInfo * info, const GstCaps * caps)
       goto alternate_no_feature;
   }
 
-  if ((info->interlace_mode == GST_VIDEO_INTERLACE_MODE_INTERLEAVED ||
-          info->interlace_mode == GST_VIDEO_INTERLACE_MODE_ALTERNATE) &&
+  if (GST_VIDEO_INFO_IS_INTERLACED (info) &&
       (s = gst_structure_get_string (structure, "field-order"))) {
     GST_VIDEO_INFO_FIELD_ORDER (info) = gst_video_field_order_from_string (s);
   } else {