From 8f6b12be48233ea5493a095c5891ddb59ef810f3 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:03:51 +0100 Subject: [PATCH] fix freeze when RAM is full or under pressure --- encoder_hard_h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/encoder_hard_h264.c b/encoder_hard_h264.c index 2c3e022..e2b2a10 100644 --- a/encoder_hard_h264.c +++ b/encoder_hard_h264.c @@ -49,14 +49,14 @@ static void *output_thread(void *userdata) { int res = ioctl(encp->fd, VIDIOC_DQBUF, &buf); if (res != 0) { fprintf(stderr, "output_thread(): ioctl(VIDIOC_DQBUF, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) failed\n"); - exit(1); + continue; } buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; res = ioctl(encp->fd, VIDIOC_DQBUF, &buf); if (res != 0) { fprintf(stderr, "output_thread(): ioctl(VIDIOC_DQBUF, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) failed\n"); - exit(1); + continue; } const uint8_t *mapped = (const uint8_t *)encp->capture_buffers[buf.index]; @@ -68,7 +68,7 @@ static void *output_thread(void *userdata) { res = ioctl(encp->fd, VIDIOC_QBUF, &buf); if (res != 0) { fprintf(stderr, "output_thread(): ioctl(VIDIOC_QBUF) failed\n"); - exit(1); + continue; } }