From dc76eb2641dfd1783a93c8f1a5348ea33a34963e Mon Sep 17 00:00:00 2001 From: Sergey Dryabzhinsky Date: Sat, 26 Nov 2016 00:48:24 +0300 Subject: [PATCH] Merge fixes for nginx 1.11.5-style cache-manager by @arut - merge some code from https://github.com/arut/nginx-rtmp-module/commit/5150993accb5edefa61d71e1c81ad8c02f515428 --- dash/ngx_rtmp_dash_module.c | 4 ++++ hls/ngx_rtmp_hls_module.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 9ca4d7d..13d6572 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -1634,7 +1634,11 @@ ngx_rtmp_dash_cleanup(void *data) // Next callback in doubled playlist length time to make sure what all // players read all segments +#if (nginx_version >= 1011005) + return cleanup->playlen * 2; +#else return cleanup->playlen / 500; +#endif } static ngx_int_t diff --git a/hls/ngx_rtmp_hls_module.c b/hls/ngx_rtmp_hls_module.c index db4baa4..15bd22a 100644 --- a/hls/ngx_rtmp_hls_module.c +++ b/hls/ngx_rtmp_hls_module.c @@ -2377,7 +2377,11 @@ ngx_rtmp_hls_cleanup(void *data) ngx_rtmp_hls_cleanup_dir(&cleanup->path, cleanup->playlen); // Next callback in half of playlist length time +#if (nginx_version >= 1011005) + return cleanup->playlen / 2; +#else return cleanup->playlen / 2000; +#endif }