mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-19 17:41:08 +02:00
fixed push & pull in auto-push mode
This commit is contained in:
parent
cdb084e375
commit
6485716fb4
|
@ -209,6 +209,7 @@ typedef struct {
|
||||||
|
|
||||||
/* auto-pushed? */
|
/* auto-pushed? */
|
||||||
unsigned auto_pushed:1;
|
unsigned auto_pushed:1;
|
||||||
|
unsigned relay:1;
|
||||||
|
|
||||||
/* input stream 0 (reserved by RTMP spec)
|
/* input stream 0 (reserved by RTMP spec)
|
||||||
* is used as free chain link */
|
* is used as free chain link */
|
||||||
|
|
|
@ -400,7 +400,7 @@ ngx_rtmp_auto_push_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
||||||
ngx_rtmp_auto_push_conf_t *apcf;
|
ngx_rtmp_auto_push_conf_t *apcf;
|
||||||
ngx_rtmp_auto_push_ctx_t *ctx;
|
ngx_rtmp_auto_push_ctx_t *ctx;
|
||||||
|
|
||||||
if (s->auto_pushed) {
|
if (s->auto_pushed || s->relay) {
|
||||||
goto next;
|
goto next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -396,6 +396,7 @@ ngx_rtmp_relay_create_remote_ctx(ngx_rtmp_session_t *s, ngx_str_t* name,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
rs->app_conf = s->app_conf;
|
rs->app_conf = s->app_conf;
|
||||||
|
rs->relay = 1;
|
||||||
rctx->session = rs;
|
rctx->session = rs;
|
||||||
ngx_rtmp_set_ctx(rs, rctx, ngx_rtmp_relay_module);
|
ngx_rtmp_set_ctx(rs, rctx, ngx_rtmp_relay_module);
|
||||||
ngx_str_set(&rs->flashver, "ngx-local-relay");
|
ngx_str_set(&rs->flashver, "ngx-local-relay");
|
||||||
|
@ -536,6 +537,10 @@ ngx_rtmp_relay_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
|
||||||
size_t n;
|
size_t n;
|
||||||
ngx_rtmp_relay_ctx_t *ctx;
|
ngx_rtmp_relay_ctx_t *ctx;
|
||||||
|
|
||||||
|
if (s->auto_pushed) {
|
||||||
|
goto next;
|
||||||
|
}
|
||||||
|
|
||||||
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_relay_module);
|
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_relay_module);
|
||||||
if (ctx && ctx->relay) {
|
if (ctx && ctx->relay) {
|
||||||
goto next;
|
goto next;
|
||||||
|
|
Loading…
Reference in a new issue