Skip to content

Commit e2ceff4

Browse files
authored
fix freeze when RAM is full or under pressure (#33)
1 parent a72f7ea commit e2ceff4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

encoder_hard_h264.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ static void *output_thread(void *userdata) {
4949
int res = ioctl(encp->fd, VIDIOC_DQBUF, &buf);
5050
if (res != 0) {
5151
fprintf(stderr, "output_thread(): ioctl(VIDIOC_DQBUF, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) failed\n");
52-
exit(1);
52+
continue;
5353
}
5454

5555
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
5656
res = ioctl(encp->fd, VIDIOC_DQBUF, &buf);
5757
if (res != 0) {
5858
fprintf(stderr, "output_thread(): ioctl(VIDIOC_DQBUF, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) failed\n");
59-
exit(1);
59+
continue;
6060
}
6161

6262
const uint8_t *mapped = (const uint8_t *)encp->capture_buffers[buf.index];
@@ -68,7 +68,7 @@ static void *output_thread(void *userdata) {
6868
res = ioctl(encp->fd, VIDIOC_QBUF, &buf);
6969
if (res != 0) {
7070
fprintf(stderr, "output_thread(): ioctl(VIDIOC_QBUF) failed\n");
71-
exit(1);
71+
continue;
7272
}
7373
}
7474

0 commit comments

Comments
 (0)