From 835f468e1b713866728deb4fac39b89aa64fd90b Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 9 Aug 2026 20:11:26 +0200 Subject: [PATCH] Prototype/Demo: minor bugfix Add failure check when opening next URing slot for a submission; this ''can'' fail when the ring is fully populated -- which in theory should never happen in our setup, yet can always, in practice... --- FrOSCon26/examples/demo-uring.cpp | 3 +++ FrOSCon26/examples/egl-display.hpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/FrOSCon26/examples/demo-uring.cpp b/FrOSCon26/examples/demo-uring.cpp index 61177d4..220501d 100644 --- a/FrOSCon26/examples/demo-uring.cpp +++ b/FrOSCon26/examples/demo-uring.cpp @@ -203,6 +203,9 @@ UringVideoPlayer::addNextReadSubmissions (io_uring& uRing, int inputFD) { size_t srcOffset = calcSrcFrame (nextRead_); io_uring_sqe* readSubmission = io_uring_get_sqe (&uRing); + if (nullptr == readSubmission) + __FAIL ("URing slot allocation failed"); + io_uring_prep_read (readSubmission ,inputFD ,& buffer_[nextRead_ % RING_SIZ] diff --git a/FrOSCon26/examples/egl-display.hpp b/FrOSCon26/examples/egl-display.hpp index 435fcfe..941427c 100644 --- a/FrOSCon26/examples/egl-display.hpp +++ b/FrOSCon26/examples/egl-display.hpp @@ -45,7 +45,7 @@ class EglDisplay using Buffer = std::array; /** - * Interface retrieve pixel data for video frames to display. + * Interface: retrieve pixel data for video frames to display. * - this is a Glib::Dispatcher, and the attached slot shall be * triggered whenever data for a new frame is available * - pixel data is accessed (threadsafe) by invoking #retrieveFrame() @@ -85,7 +85,7 @@ class EglDisplay float scaleX_{1}; float scaleY_{1}; - /** Callback functor to access current pixel data */ + /** Callback to retrieve pixel data */ PixelFeed& pixelFeed_{}; void openDisplay (Gtk::Window&);