Commit 11711871 authored by hyc's avatar hyc

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.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23621 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 7aa57da0
...@@ -2306,12 +2306,16 @@ static int http_prepare_data(HTTPContext *c) ...@@ -2306,12 +2306,16 @@ static int http_prepare_data(HTTPContext *c)
else { else {
AVPacket pkt; AVPacket pkt;
redo: redo:
if (av_read_frame(c->fmt_in, &pkt) < 0) { ret = av_read_frame(c->fmt_in, &pkt);
if (c->stream->feed && c->stream->feed->feed_opened) { if (ret < 0) {
if (c->stream->feed) {
/* if coming from feed, it means we reached the end of the /* if coming from feed, it means we reached the end of the
ffm file, so must wait for more data */ ffm file, so must wait for more data */
c->state = HTTPSTATE_WAIT_FEED; c->state = HTTPSTATE_WAIT_FEED;
return 1; /* state changed */ return 1; /* state changed */
} else if (ret == AVERROR(EAGAIN)) {
/* input not ready, come back later */
return 0;
} else { } else {
if (c->stream->loop) { if (c->stream->loop) {
av_close_input_file(c->fmt_in); av_close_input_file(c->fmt_in);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment