mxfmetadata: Use display width/height instead of stored width/height
authorSebastian Dröge <sebastian@centricular.com>
Wed, 5 Jul 2017 10:52:25 +0000 (13:52 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 5 Jul 2017 10:54:23 +0000 (13:54 +0300)
Stored values contain padding and alignment, and should only be used as
fallback if neither display values nor sampled values exist.

gst/mxf/mxfmetadata.c

index 0fbc11e1da3afaaa67cbe854e325ee4a8c94e33f..8f095926b6ee38db5b9e59fe7875be3db212dc03 100644 (file)
@@ -4949,6 +4949,14 @@ void mxf_metadata_generic_picture_essence_descriptor_set_caps
 
   width = self->stored_width;
   height = self->stored_height;
+  if (self->sampled_width && self->sampled_height) {
+    width = self->sampled_width;
+    height = self->sampled_height;
+  }
+  if (self->display_width && self->display_height) {
+    width = self->display_width;
+    height = self->display_height;
+  }
 
   /* If the video is stored as separate fields the
    * height is only the height of one field, i.e.