From 77d8efcbe3f5cbbed518b0bc714e111f70413e71 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 4 Sep 2021 20:00:02 +0000 Subject: [PATCH] fb_pool: Return true from resize when dimensions change --- include/neatvnc.h | 2 +- src/fb_pool.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/neatvnc.h b/include/neatvnc.h index 64e7115..f62dba5 100644 --- a/include/neatvnc.h +++ b/include/neatvnc.h @@ -99,7 +99,7 @@ uint32_t nvnc_fb_get_fourcc_format(const struct nvnc_fb* fb); struct nvnc_fb_pool* nvnc_fb_pool_new(uint16_t width, uint16_t height, uint32_t fourcc_format); -void nvnc_fb_pool_resize(struct nvnc_fb_pool*, uint16_t width, uint16_t height, +bool nvnc_fb_pool_resize(struct nvnc_fb_pool*, uint16_t width, uint16_t height, uint32_t fourcc_format); void nvnc_fb_pool_ref(struct nvnc_fb_pool*); diff --git a/src/fb_pool.c b/src/fb_pool.c index c4089ba..fe7846d 100644 --- a/src/fb_pool.c +++ b/src/fb_pool.c @@ -75,18 +75,20 @@ static void nvnc_fb_pool__destroy(struct nvnc_fb_pool* self) } EXPORT -void nvnc_fb_pool_resize(struct nvnc_fb_pool* self, uint16_t width, +bool nvnc_fb_pool_resize(struct nvnc_fb_pool* self, uint16_t width, uint16_t height, uint32_t fourcc_format) { if (width == self->width && height == self->height && fourcc_format == self->fourcc_format) - return; + return false; nvnc_fb_pool__destroy_fbs(self); self->width = width; self->height = height; self->fourcc_format = fourcc_format; + + return true; } EXPORT