diff --git a/ffserver.c b/ffserver.c
index 4693cc7b3cdcf1ac62e415db113d61fec24dcc9d..63bd2677b2eea8ec52c5542aa505f195cb75225d 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -92,6 +92,10 @@ static const char *http_state[] = {
     "RTSP_SEND_PACKET",
 };
 
+#if !FF_API_MAX_STREAMS
+#define MAX_STREAMS 20
+#endif
+
 #define IOBUFFER_INIT_SIZE 8192
 
 /* timeouts are in ms */