arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.45k stars 3.51k forks source link

<rtmp_auto_push> only work on first <port> when there are two <server> contexts #770

Open sergeantg opened 8 years ago

sergeantg commented 8 years ago

Is this a bug and how could I solve this?

my nginx.conf is something like this:

worker_processes 16;
events {
    worker_connections  65535;
}

http {
   server {
    listen 80;
    location /control {
        rtmp_control all;
    }
    location /stat.xml {
        rtmp_stat all;
    }
    location /stat {
        proxy_pass http://127.0.0.1/stat.xml;
        xslt_stylesheet /usr/local/nginx/conf/stat.xsl;
    }
   }
}

rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp_socket_dir /var/tmp;

rtmp {
        server {
         listen 1935;
         application push1 {
          live on;
              }
    }

    server {
         listen 1936;
         application push2 {
          live on;
              }
    }
}  
leemingtian commented 8 years ago

I think this is really a bug because I remember that I have met the same problem too.

RocFang commented 8 years ago

Yes, it is indeed a bug.

let code talks:

    for (n = 0; n < cycle->listening.nelts; ++n, ++ls) {
        if (ls->handler == ngx_rtmp_init_connection) {
            lss = ls;
            break;
        }
    }