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...
This commit is contained in:
Fischlurch 2026-08-09 20:11:26 +02:00
parent 3f61b106cc
commit 835f468e1b
2 changed files with 5 additions and 2 deletions

View file

@ -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]

View file

@ -45,7 +45,7 @@ class EglDisplay
using Buffer = std::array<PIX, WIDTH*HEIGHT * 3 >;
/**
* 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&);