mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-06-30 00:28:58 +02:00
Fixed record from infinite loop
This commit is contained in:
parent
dc76eb2641
commit
d86287fe3c
|
@ -990,14 +990,6 @@ ngx_rtmp_record_write_frame(ngx_rtmp_session_t *s,
|
||||||
ngx_rtmp_record_node_close(s, rctx);
|
ngx_rtmp_record_node_close(s, rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* watch size interval */
|
|
||||||
if ((rracf->interval_size && rctx->file.offset >= (ngx_int_t) rracf->interval_size) ||
|
|
||||||
(rracf->max_frames && rctx->nframes >= rracf->max_frames))
|
|
||||||
{
|
|
||||||
ngx_rtmp_record_node_close(s, rctx);
|
|
||||||
ngx_rtmp_record_node_open(s, rctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1070,9 +1062,9 @@ ngx_rtmp_record_node_avd(ngx_rtmp_session_t *s, ngx_rtmp_record_rec_ctx_t *rctx,
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rctx->file.fd == NGX_INVALID_FILE) {
|
/*if (rctx->file.fd == NGX_INVALID_FILE) {
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (h->type == NGX_RTMP_MSG_AUDIO &&
|
if (h->type == NGX_RTMP_MSG_AUDIO &&
|
||||||
(rracf->flags & NGX_RTMP_RECORD_AUDIO) == 0)
|
(rracf->flags & NGX_RTMP_RECORD_AUDIO) == 0)
|
||||||
|
@ -1093,9 +1085,9 @@ ngx_rtmp_record_node_avd(ngx_rtmp_session_t *s, ngx_rtmp_record_rec_ctx_t *rctx,
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rracf->interval != NGX_CONF_UNSET_MSEC)
|
||||||
|
{
|
||||||
// record interval should work if set, manual mode or not
|
// record interval should work if set, manual mode or not
|
||||||
if (rracf->interval != (ngx_msec_t) NGX_CONF_UNSET) {
|
|
||||||
|
|
||||||
next = rctx->last;
|
next = rctx->last;
|
||||||
next.msec += rracf->interval;
|
next.msec += rracf->interval;
|
||||||
next.sec += (next.msec / 1000);
|
next.sec += (next.msec / 1000);
|
||||||
|
@ -1108,8 +1100,9 @@ ngx_rtmp_record_node_avd(ngx_rtmp_session_t *s, ngx_rtmp_record_rec_ctx_t *rctx,
|
||||||
ngx_rtmp_record_node_close(s, rctx);
|
ngx_rtmp_record_node_close(s, rctx);
|
||||||
ngx_rtmp_record_node_open(s, rctx);
|
ngx_rtmp_record_node_open(s, rctx);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (!rctx->failed) {
|
else if (!rctx->failed)
|
||||||
|
{
|
||||||
ngx_rtmp_record_node_open(s, rctx);
|
ngx_rtmp_record_node_open(s, rctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue