New submission from Miroslav SlugeÅ <[email protected]>:
FFserver in version 0.6.2 use 100% CPU while streaming, this is very important
for ffserver users, without this bug fixed ffserver is unusable, patch is
attached.
----------
files: ffserver.diff
messages: 13913
priority: normal
status: new
substatus: new
title: FFserver - 100% cpu usage while streaming
type: patch
______________________________________________
Libav issue tracker <[email protected]>
<https://roundup.libav.org/issue2673>
______________________________________________
diff -Naur ffmpeg-dmo-0.6.2/ffserver.c ffmpeg-dmo-0.6.2.old//ffserver.c
--- ffmpeg-dmo-0.6.2/ffserver.c 2011-04-02 13:43:53.000000000 +0200
+++ ffmpeg-dmo-0.6.2.old//ffserver.c 2011-03-23 22:34:48.000000000 +0100
@@ -2628,10 +2628,10 @@
len = recv(c->fd, c->buffer_ptr, 1, 0);
if (len < 0) {
- if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
- ff_neterrno() == FF_NETERROR(EINTR)) return 0;
- /* error : close connection */
- goto fail;
+ if (ff_neterrno() != FF_NETERROR(EAGAIN) &&
+ ff_neterrno() != FF_NETERROR(EINTR))
+ /* error : close connection */
+ goto fail;
} else if (len == 0) {
/* end of connection : close it */
goto fail;
@@ -2654,10 +2654,10 @@
len = recv(c->fd, c->buffer_ptr,
FFMIN(c->chunk_size, c->buffer_end - c->buffer_ptr), 0);
if (len < 0) {
- if (ff_neterrno() == FF_NETERROR(EAGAIN) ||
- ff_neterrno() == FF_NETERROR(EINTR)) return 0;
- /* error : close connection */
- goto fail;
+ if (ff_neterrno() != FF_NETERROR(EAGAIN) &&
+ ff_neterrno() != FF_NETERROR(EINTR))
+ /* error : close connection */
+ goto fail;
} else if (len == 0)
/* end of connection : close it */
goto fail;