fixed push & pull in auto-push mode

This commit is contained in:
Roman Arutyunyan 2012-09-22 16:42:43 +04:00
parent cdb084e375
commit 6485716fb4
3 changed files with 7 additions and 1 deletions

View file

@ -209,6 +209,7 @@ typedef struct {
/* auto-pushed? */
unsigned auto_pushed:1;
unsigned relay:1;
/* input stream 0 (reserved by RTMP spec)
* is used as free chain link */

View file

@ -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_ctx_t *ctx;
if (s->auto_pushed) {
if (s->auto_pushed || s->relay) {
goto next;
}

View file

@ -396,6 +396,7 @@ ngx_rtmp_relay_create_remote_ctx(ngx_rtmp_session_t *s, ngx_str_t* name,
return NULL;
}
rs->app_conf = s->app_conf;
rs->relay = 1;
rctx->session = rs;
ngx_rtmp_set_ctx(rs, rctx, ngx_rtmp_relay_module);
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;
ngx_rtmp_relay_ctx_t *ctx;
if (s->auto_pushed) {
goto next;
}
ctx = ngx_rtmp_get_module_ctx(s, ngx_rtmp_relay_module);
if (ctx && ctx->relay) {
goto next;