[FFmpeg-cvslog] r23621 - trunk/ffserver.c

hyc subversion
Wed Jun 16 03:12:26 CEST 2010


Author: hyc
Date: Wed Jun 16 03:12:26 2010
New Revision: 23621

Log:
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.

Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	Wed Jun 16 00:38:16 2010	(r23620)
+++ trunk/ffserver.c	Wed Jun 16 03:12:26 2010	(r23621)
@@ -2306,12 +2306,16 @@ static int http_prepare_data(HTTPContext
         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);



More information about the ffmpeg-cvslog mailing list