diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-01-28 11:56:36 -0500 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2016-01-28 14:48:11 -0500 |
commit | acb7205f91aec627dac0a5651b0ac7c411d64d77 (patch) | |
tree | 2f3cca5736e7a4a3afe8380afde4542f3f14cbba /gst | |
parent | 80c72169c64541f27e4f649f021b747adbd32efe (diff) | |
download | gstreamer-plugins-bad-acb7205f91aec627dac0a5651b0ac7c411d64d77.tar.gz |
videoparse: Fix framesize calculation
When the framesize is not specified, we try and calculate a size from
the strides and offset information. This was done with the sum of
offsets + the size of the last frame. That is just wrong method. We also
need to account for video meta that may be flipping two planes. An
example is if you convert I420 to YV12 by flipping the two last offsets.
https://bugzilla.gnome.org/show_bug.cgi?id=760270
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rawparse/gstvideoparse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/rawparse/gstvideoparse.c b/gst/rawparse/gstvideoparse.c index 92733c6ac..717b21afa 100644 --- a/gst/rawparse/gstvideoparse.c +++ b/gst/rawparse/gstvideoparse.c @@ -467,10 +467,13 @@ gst_video_parse_update_info (GstVideoParse * vp) if (update_size) { framesize = 0; - for (i = 0; i < GST_VIDEO_INFO_N_PLANES (info); i++) - framesize += info->offset[i]; + for (i = 0; i < GST_VIDEO_INFO_N_PLANES (info); i++) { + gint planesize = info->offset[i]; + planesize += gst_video_parse_get_plane_size (info, i); - framesize += gst_video_parse_get_plane_size (info, i - 1); + if (planesize > framesize) + framesize = planesize; + } info->size = framesize; } |