Skip to content

Commit 709b173

Browse files
committed
fixed done-family notifications when on_play/on_published failed
1 parent 682d24d commit 709b173

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ngx_rtmp_notify_module.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,17 @@ ngx_rtmp_notify_parse_http_header(ngx_rtmp_session_t *s,
915915
}
916916

917917

918+
static void
919+
ngx_rtmp_notify_clear_flag(ngx_rtmp_session_t *s, ngx_uint_t flag)
920+
{
921+
ngx_rtmp_notify_ctx_t *ctx;
922+
923+
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_notify_module);
924+
925+
ctx->flags &= ~flag;
926+
}
927+
928+
918929
static ngx_int_t
919930
ngx_rtmp_notify_connect_handle(ngx_rtmp_session_t *s,
920931
void *arg, ngx_chain_t *in)
@@ -959,6 +970,7 @@ ngx_rtmp_notify_publish_handle(ngx_rtmp_session_t *s,
959970

960971
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
961972
if (rc == NGX_ERROR) {
973+
ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PUBLISHING);
962974
return NGX_ERROR;
963975
}
964976

@@ -991,6 +1003,7 @@ ngx_rtmp_notify_play_handle(ngx_rtmp_session_t *s,
9911003

9921004
rc = ngx_rtmp_notify_parse_http_retcode(s, in);
9931005
if (rc == NGX_ERROR) {
1006+
ngx_rtmp_notify_clear_flag(s, NGX_RTMP_NOTIFY_PLAYING);
9941007
return NGX_ERROR;
9951008
}
9961009

0 commit comments

Comments
 (0)