]> git.sesse.net Git - ffmpeg/commitdiff
support for unlimited feed size
authorAlex Beregszaszi <alex@rtfs.hu>
Sun, 13 Nov 2005 03:26:43 +0000 (03:26 +0000)
committerAlex Beregszaszi <alex@rtfs.hu>
Sun, 13 Nov 2005 03:26:43 +0000 (03:26 +0000)
Originally committed as revision 4697 to svn://svn.ffmpeg.org/ffmpeg/trunk

doc/ffserver.conf
ffserver.c

index 6ce7aae4fcf42b20c63d5a0f1e0d4bbef2b193df..431ef93a948eee8b8b918a6e81b608e3b4c70552 100644 (file)
@@ -41,7 +41,7 @@ NoDaemon
 # previously recorded live stream. The request should contain:
 # "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
 # a path where the feed is stored on disk. You also specify the
-# maximum size of the feed (100M bytes here). Default:
+# maximum size of the feed, where zero means unlimited. Default:
 # File=/tmp/feed_name.ffm FileMaxSize=5M
 File /tmp/feed1.ffm
 FileMaxSize 200K
index c2b90978620796b3c9528cc52bd5ce144f5c1165..bbff9f5b74b353cc13331d3c6e59949f92fcf60c 100644 (file)
@@ -218,7 +218,7 @@ typedef struct FFStream {
     int readonly;        /* True if writing is prohibited to the file */
     int conns_served;
     int64_t bytes_served;
-    int64_t feed_max_size;      /* maximum storage size */
+    int64_t feed_max_size;      /* maximum storage size, zero means unlimited */
     int64_t feed_write_index;   /* current write position in feed (it wraps round) */
     int64_t feed_size;          /* current size of feed */
     struct FFStream *next_feed;
@@ -2417,7 +2417,7 @@ static int http_receive_data(HTTPContext *c)
                 feed->feed_size = feed->feed_write_index;
 
             /* handle wrap around if max file size reached */
-            if (feed->feed_write_index >= c->stream->feed_max_size)
+            if (c->stream->feed_max_size && feed->feed_write_index >= c->stream->feed_max_size)
                 feed->feed_write_index = FFM_PACKET_SIZE;
 
             /* write index */
@@ -3539,7 +3539,7 @@ static void build_feed_streams(void)
         feed->feed_write_index = ffm_read_write_index(fd);
         feed->feed_size = lseek(fd, 0, SEEK_END);
         /* ensure that we do not wrap before the end of file */
-        if (feed->feed_max_size < feed->feed_size)
+        if (feed->feed_max_size && feed->feed_max_size < feed->feed_size)
             feed->feed_max_size = feed->feed_size;
 
         close(fd);