summaryrefslogtreecommitdiff
path: root/ffserver.c
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2005-11-13 03:26:43 +0000
committerAlex Beregszaszi <alex@rtfs.hu>2005-11-13 03:26:43 +0000
commit6b0bdc754b2197d027c26589ed63a41ad19f87eb (patch)
tree0c5b8fc4213aa5bd96a367d04742e3b354fcf9bb /ffserver.c
parentac031f3c6cf5fc108c64e2e861411760131b1d56 (diff)
downloadffmpeg-6b0bdc754b2197d027c26589ed63a41ad19f87eb.tar.gz
support for unlimited feed size
Originally committed as revision 4697 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ffserver.c b/ffserver.c
index c2b9097862..bbff9f5b74 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -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);