From 8e344d799483145666fa875344bddf67a324e561 Mon Sep 17 00:00:00 2001 From: Sergey Dryabzhinsky Date: Thu, 3 Jun 2021 15:40:00 +0300 Subject: [PATCH] For issue #332 - bigger buffers for HLS/DASH, allow define them on compile time --- dash/ngx_rtmp_dash_module.c | 11 +++++++---- hls/ngx_rtmp_hls_module.c | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 1038ae2..21bc73c 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -22,11 +22,14 @@ static char * ngx_rtmp_dash_merge_app_conf(ngx_conf_t *cf, static ngx_int_t ngx_rtmp_dash_write_init_segments(ngx_rtmp_session_t *s); static ngx_int_t ngx_rtmp_dash_ensure_directory(ngx_rtmp_session_t *s); - -#define NGX_RTMP_DASH_BUFSIZE (1024*1024) -#define NGX_RTMP_DASH_MAX_MDAT (10*1024*1024) +/* Big buffer for 8k (QHD) cameras */ +#ifndef NGX_RTMP_DASH_BUFSIZE +#define NGX_RTMP_DASH_BUFSIZE (16*1024*1024) +#endif +#define NGX_RTMP_DASH_MAX_MDAT (16*1024*1024) #define NGX_RTMP_DASH_MAX_SAMPLES 1024 -#define NGX_RTMP_DASH_DIR_ACCESS 0744 +/* Allow access to www-data (web-server) and others too */ +#define NGX_RTMP_DASH_DIR_ACCESS 0755 #define NGX_RTMP_DASH_GMT_LENGTH sizeof("1970-09-28T12:00:00+06:00") diff --git a/hls/ngx_rtmp_hls_module.c b/hls/ngx_rtmp_hls_module.c index 68e7b52..38df854 100644 --- a/hls/ngx_rtmp_hls_module.c +++ b/hls/ngx_rtmp_hls_module.c @@ -30,8 +30,12 @@ static ngx_int_t ngx_rtmp_hls_ensure_directory(ngx_rtmp_session_t *s, ngx_str_t *path); -#define NGX_RTMP_HLS_BUFSIZE (1024*1024) -#define NGX_RTMP_HLS_DIR_ACCESS 0744 +/* Big buffer for 8k (QHD) cameras */ +#ifndef NGX_RTMP_HLS_BUFSIZE +#define NGX_RTMP_HLS_BUFSIZE (16*1024*1024) +#endif +/* Allow access to www-data (web-server) and others too */ +#define NGX_RTMP_HLS_DIR_ACCESS 0755 typedef struct {