From cc8b079b88e7f8f07b3baf5c82bdba2f039025d0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 29 Oct 2021 20:01:01 +0200 Subject: [PATCH] fb_generic: simplify showFrame() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/33256507f9020c23eb9617d40f26f0f8f74e96b5 Author: vanhofen Date: 2021-10-29 (Fri, 29 Oct 2021) Origin message was: ------------------ - fb_generic: simplify showFrame() --- src/driver/fb_generic.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index dc42d3c4d..c99e458ad 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -1589,7 +1589,13 @@ bool CFrameBuffer::showFrame(const std::string & filename, int fallback_mode) std::string picture = getIconPath(filename); bool ret = false; - if (access(picture.c_str(), F_OK) == 0 && !(fallback_mode & SHOW_FRAME_FALLBACK_MODE_IMAGE_UNSCALED)) + if (picture.empty()) + { + dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], image not found: %s\n", __func__, __LINE__, filename.c_str()); + return ret; + } + + if (!(fallback_mode & SHOW_FRAME_FALLBACK_MODE_IMAGE_UNSCALED)) { if (videoDecoder) { @@ -1604,14 +1610,6 @@ bool CFrameBuffer::showFrame(const std::string & filename, int fallback_mode) else dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], no videoplayer instance available\n", __func__, __LINE__); } - else - { - if (!(fallback_mode & SHOW_FRAME_FALLBACK_MODE_IMAGE_UNSCALED)) - { - dprintf(DEBUG_NORMAL,"[CFrameBuffer]\[%s - %d], image not found: %s\n", __func__, __LINE__, picture.c_str()); - picture = ""; - } - } if (!ret) {