mirror of
https://github.com/arut/nginx-rtmp-module.git
synced 2025-08-06 15:00:18 +08:00
fixed static code analysis errors; thanks to @pgbi
This commit is contained in:
@ -453,7 +453,7 @@ ngx_rtmp_core_application(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
cscf = pctx->srv_conf[ngx_rtmp_core_module.ctx_index];
|
cscf = pctx->srv_conf[ngx_rtmp_core_module.ctx_index];
|
||||||
|
|
||||||
cacfp = ngx_array_push(&cscf->applications);
|
cacfp = ngx_array_push(&cscf->applications);
|
||||||
if (cacf == NULL) {
|
if (cacfp == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,14 +118,16 @@ ngx_rtmp_init_connection(ngx_connection_t *c)
|
|||||||
c->number, &c->addr_text);
|
c->number, &c->addr_text);
|
||||||
|
|
||||||
s = ngx_rtmp_init_session(c, addr_conf);
|
s = ngx_rtmp_init_session(c, addr_conf);
|
||||||
|
if (s == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* only auto-pushed connections are
|
/* only auto-pushed connections are
|
||||||
* done through unix socket */
|
* done through unix socket */
|
||||||
|
|
||||||
s->auto_pushed = unix_socket;
|
s->auto_pushed = unix_socket;
|
||||||
|
|
||||||
if (s) {
|
ngx_rtmp_handshake(s);
|
||||||
ngx_rtmp_handshake(s);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -264,27 +266,25 @@ ngx_rtmp_close_session_handler(ngx_event_t *e)
|
|||||||
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, c->log, 0, "close session");
|
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, c->log, 0, "close session");
|
||||||
|
|
||||||
if (s) {
|
ngx_rtmp_fire_event(s, NGX_RTMP_DISCONNECT, NULL, NULL);
|
||||||
ngx_rtmp_fire_event(s, NGX_RTMP_DISCONNECT, NULL, NULL);
|
|
||||||
|
|
||||||
if (s->ping_evt.timer_set) {
|
if (s->ping_evt.timer_set) {
|
||||||
ngx_del_timer(&s->ping_evt);
|
ngx_del_timer(&s->ping_evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->in_old_pool) {
|
if (s->in_old_pool) {
|
||||||
ngx_destroy_pool(s->in_old_pool);
|
ngx_destroy_pool(s->in_old_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->in_pool) {
|
if (s->in_pool) {
|
||||||
ngx_destroy_pool(s->in_pool);
|
ngx_destroy_pool(s->in_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_rtmp_free_handshake_buffers(s);
|
ngx_rtmp_free_handshake_buffers(s);
|
||||||
|
|
||||||
while (s->out_pos != s->out_last) {
|
while (s->out_pos != s->out_last) {
|
||||||
ngx_rtmp_free_shared_chain(cscf, s->out[s->out_pos++]);
|
ngx_rtmp_free_shared_chain(cscf, s->out[s->out_pos++]);
|
||||||
s->out_pos %= s->out_queue;
|
s->out_pos %= s->out_queue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngx_rtmp_close_connection(c);
|
ngx_rtmp_close_connection(c);
|
||||||
|
@ -1026,7 +1026,7 @@ ngx_rtmp_record_node_av(ngx_rtmp_session_t *s, ngx_rtmp_record_rec_ctx_t *rctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_rtmp_get_video_frame_type(in) == NGX_RTMP_VIDEO_KEY_FRAME &&
|
if (ngx_rtmp_get_video_frame_type(in) == NGX_RTMP_VIDEO_KEY_FRAME &&
|
||||||
(codec_ctx->video_codec_id != NGX_RTMP_VIDEO_H264 ||
|
((codec_ctx && codec_ctx->video_codec_id != NGX_RTMP_VIDEO_H264) ||
|
||||||
!ngx_rtmp_is_codec_header(in)))
|
!ngx_rtmp_is_codec_header(in)))
|
||||||
{
|
{
|
||||||
rctx->video_key_sent = 1;
|
rctx->video_key_sent = 1;
|
||||||
|
Reference in New Issue
Block a user