From 1c3dc989ef5e93d9f87483320642d9fd66ccb0a7 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 25 Nov 2016 13:25:58 +0100 Subject: [PATCH 1/2] Work around deletion of still-needed init segments I assume they get accidentally deleted right after they're written, before the playlist is first created. Leave them around for another cleanup cycle rather than risk deleting them while still needed. --- dash/ngx_rtmp_dash_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash/ngx_rtmp_dash_module.c b/dash/ngx_rtmp_dash_module.c index 13d6572..1038ae2 100644 --- a/dash/ngx_rtmp_dash_module.c +++ b/dash/ngx_rtmp_dash_module.c @@ -1565,7 +1565,7 @@ ngx_rtmp_dash_cleanup_dir(ngx_str_t *ppath, ngx_msec_t playlen) "dash: cleanup '%V' allowed, mpd missing '%s'", &name, mpd_path); - max_age = 0; + max_age = playlen / 500; } else if (name.len >= 4 && name.data[name.len - 4] == '.' && name.data[name.len - 3] == 'm' && From 916f3f83747733bd1e0c99611f3203d5b502a0e6 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Fri, 25 Nov 2016 13:51:11 +0100 Subject: [PATCH 2/2] Simplify freeing the data chain --- ngx_rtmp_live_module.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ngx_rtmp_live_module.c b/ngx_rtmp_live_module.c index d0ee9c8..8380d94 100644 --- a/ngx_rtmp_live_module.c +++ b/ngx_rtmp_live_module.c @@ -1138,11 +1138,7 @@ ngx_rtmp_live_data(ngx_rtmp_session_t *s, ngx_rtmp_header_t *h, ss->current_time = cs->timestamp; } - if (data) { - ngx_rtmp_free_shared_chain(cscf, data); - } - - if (rpkt && !data) { + if (rpkt) { ngx_rtmp_free_shared_chain(cscf, rpkt); }