Skip to content

Commit

Permalink
fix freeze when RAM is full or under pressure (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Nov 24, 2024
1 parent a72f7ea commit e2ceff4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions encoder_hard_h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
}
}

Expand Down

0 comments on commit e2ceff4

Please sign in to comment.