summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-27 11:44:49 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-28 12:01:35 +0100
commitbb72efb2e730b29fb8cb36ca1defccb9b963c4e3 (patch)
tree5411727bd0516c1112ebf523f7017e9b1b7b3231
parentdd3df4589d2414bce092806e7dbe669b15022f69 (diff)
libs: surface: merge two loops into one
Merge two loops into one for setting offsets and strides in the external buffer descriptor.
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurface.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c
index fac1174e..6ee8e178 100644
--- a/gst-libs/gst/vaapi/gstvaapisurface.c
+++ b/gst-libs/gst/vaapi/gstvaapisurface.c
@@ -165,14 +165,14 @@ gst_vaapi_surface_init_full (GstVaapiSurface * surface,
}
extbuf.num_planes = GST_VIDEO_INFO_N_PLANES (vip);
- if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES) {
- for (i = 0; i < extbuf.num_planes; i++)
- extbuf.pitches[i] = GST_VIDEO_INFO_PLANE_STRIDE (vip, i);
- extbuf_needed = TRUE;
- }
- if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS) {
- for (i = 0; i < extbuf.num_planes; i++)
- extbuf.offsets[i] = GST_VIDEO_INFO_PLANE_OFFSET (vip, i);
+ if (surface_allocation_flags & (GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES |
+ GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS)) {
+ for (i = 0; i < extbuf.num_planes; i++) {
+ if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_STRIDES)
+ extbuf.pitches[i] = GST_VIDEO_INFO_PLANE_STRIDE (vip, i);
+ if (surface_allocation_flags & GST_VAAPI_SURFACE_ALLOC_FLAG_FIXED_OFFSETS)
+ extbuf.offsets[i] = GST_VIDEO_INFO_PLANE_OFFSET (vip, i);
+ }
extbuf_needed = TRUE;
}