Skip to content

Commit 5e5dd79

Browse files
committed
reverted changes in live module
1 parent ee55c21 commit 5e5dd79

File tree

2 files changed

+13
-45
lines changed

2 files changed

+13
-45
lines changed

ngx_rtmp_live_module.c

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -563,28 +563,28 @@ ngx_rtmp_live_join(ngx_rtmp_session_t *s, u_char *name, unsigned publisher)
563563
}
564564

565565

566-
static void
567-
ngx_rtmp_live_leave(ngx_rtmp_session_t *s)
566+
static ngx_int_t
567+
ngx_rtmp_live_close_stream(ngx_rtmp_session_t *s, ngx_rtmp_close_stream_t *v)
568568
{
569-
ngx_rtmp_session_t *ss;
570-
ngx_rtmp_live_ctx_t *ctx, **cctx, *pctx;
571-
ngx_rtmp_live_stream_t **stream;
572-
ngx_rtmp_live_app_conf_t *lacf;
569+
ngx_rtmp_session_t *ss;
570+
ngx_rtmp_live_ctx_t *ctx, **cctx, *pctx;
571+
ngx_rtmp_live_stream_t **stream;
572+
ngx_rtmp_live_app_conf_t *lacf;
573573

574574
lacf = ngx_rtmp_get_module_app_conf(s, ngx_rtmp_live_module);
575575
if (lacf == NULL) {
576-
return;
576+
goto next;
577577
}
578578

579579
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_live_module);
580580
if (ctx == NULL) {
581-
return;
581+
goto next;
582582
}
583583

584584
if (ctx->stream == NULL) {
585585
ngx_log_debug0(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
586-
"live: leave: not joined");
587-
return;
586+
"live: not joined");
587+
goto next;
588588
}
589589

590590
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
@@ -622,7 +622,7 @@ ngx_rtmp_live_leave(ngx_rtmp_session_t *s)
622622

623623
if (ctx->stream->ctx) {
624624
ctx->stream = NULL;
625-
return;
625+
goto next;
626626
}
627627

628628
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
@@ -631,7 +631,7 @@ ngx_rtmp_live_leave(ngx_rtmp_session_t *s)
631631

632632
stream = ngx_rtmp_live_get_stream(s, ctx->stream->name, 0);
633633
if (stream == NULL) {
634-
return;
634+
goto next;
635635
}
636636
*stream = (*stream)->next;
637637

@@ -643,15 +643,7 @@ ngx_rtmp_live_leave(ngx_rtmp_session_t *s)
643643
ngx_rtmp_send_status(s, "NetStream.Play.Stop", "status", "Stop live");
644644
}
645645

646-
return;
647-
}
648-
649-
650-
static ngx_int_t
651-
ngx_rtmp_live_close_stream(ngx_rtmp_session_t *s, ngx_rtmp_close_stream_t *v)
652-
{
653-
ngx_rtmp_live_leave(s);
654-
646+
next:
655647
return next_close_stream(s, v);
656648
}
657649

@@ -1121,27 +1113,6 @@ ngx_rtmp_live_play(ngx_rtmp_session_t *s, ngx_rtmp_play_t *v)
11211113
}
11221114

11231115

1124-
ngx_int_t
1125-
ngx_rtmp_live_redirect(ngx_rtmp_session_t *s, u_char *name)
1126-
{
1127-
ngx_uint_t publishing;
1128-
ngx_rtmp_live_ctx_t *ctx;
1129-
1130-
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_live_module);
1131-
if (ctx == NULL) {
1132-
return NGX_ERROR;
1133-
}
1134-
1135-
publishing = ctx->publishing;
1136-
1137-
ngx_rtmp_live_leave(s);
1138-
1139-
ngx_rtmp_live_join(s, name, publishing);
1140-
1141-
return NGX_OK;
1142-
}
1143-
1144-
11451116
static ngx_int_t
11461117
ngx_rtmp_live_postconfiguration(ngx_conf_t *cf)
11471118
{

ngx_rtmp_live_module.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ typedef struct {
7777
} ngx_rtmp_live_app_conf_t;
7878

7979

80-
ngx_int_t ngx_rtmp_live_redirect(ngx_rtmp_session_t *s, u_char *name);
81-
82-
8380
extern ngx_module_t ngx_rtmp_live_module;
8481

8582

0 commit comments

Comments
 (0)