diff options
author | Howard Chu <hyc@highlandsun.com> | 2010-06-16 01:12:26 +0000 |
---|---|---|
committer | Howard Chu <hyc@highlandsun.com> | 2010-06-16 01:12:26 +0000 |
commit | d9aac2676161e4116574482508d9c7f0c4398f49 (patch) | |
tree | 1fc3a9e3878cdfcf15fa17a1044089e2b3b7e1c5 | |
parent | 891263eff20681a225bce5ba45232de40513b9d3 (diff) | |
download | ffmpeg-d9aac2676161e4116574482508d9c7f0c4398f49.tar.gz |
When reading a stream, should retry on EAGAIN instead of just failing. Also,
when reading a live feed, should retry regardless of whether any client has
opened the stream.
Originally committed as revision 23621 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffserver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c index 77340af3df..31d0268d05 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2306,12 +2306,16 @@ static int http_prepare_data(HTTPContext *c) else { AVPacket pkt; redo: - if (av_read_frame(c->fmt_in, &pkt) < 0) { - if (c->stream->feed && c->stream->feed->feed_opened) { + ret = av_read_frame(c->fmt_in, &pkt); + if (ret < 0) { + if (c->stream->feed) { /* if coming from feed, it means we reached the end of the ffm file, so must wait for more data */ c->state = HTTPSTATE_WAIT_FEED; return 1; /* state changed */ + } else if (ret == AVERROR(EAGAIN)) { + /* input not ready, come back later */ + return 0; } else { if (c->stream->loop) { av_close_input_file(c->fmt_in); |