video-info: Also check the stride and offset are equal
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 12 May 2014 17:18:50 +0000 (13:18 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 12 May 2014 22:22:32 +0000 (18:22 -0400)
gst_video_info_is_equal() was not checking if stride and offset
had changed.

https://bugzilla.gnome.org/show_bug.cgi?id=729896

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

index 907bb6915fc75aa3807dae62e3caaad1729cbae2..b0e9df77c94cd60653e3bb5936c3df091a13d871 100644 (file)
@@ -280,6 +280,8 @@ no_height:
 gboolean
 gst_video_info_is_equal (const GstVideoInfo * info, const GstVideoInfo * other)
 {
+  gint i;
+
   if (GST_VIDEO_INFO_FORMAT (info) != GST_VIDEO_INFO_FORMAT (other))
     return FALSE;
   if (GST_VIDEO_INFO_INTERLACE_MODE (info) !=
@@ -301,6 +303,14 @@ gst_video_info_is_equal (const GstVideoInfo * info, const GstVideoInfo * other)
     return FALSE;
   if (GST_VIDEO_INFO_FPS_D (info) != GST_VIDEO_INFO_FPS_D (other))
     return FALSE;
+
+  for (i = 0; i < info->finfo->n_planes; i++) {
+    if (info->stride[i] != other->stride[i])
+      return FALSE;
+    if (info->offset[i] != other->offset[i])
+      return FALSE;
+  }
+
   return TRUE;
 }