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' && 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); }