mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
merge from srs2, fix #503
This commit is contained in:
commit
5fec59ace2
34 changed files with 104 additions and 13 deletions
|
@ -209,6 +209,7 @@ Please select your language:
|
||||||
|
|
||||||
### V2 changes
|
### V2 changes
|
||||||
|
|
||||||
|
* v2.0, 2017-02-09, fix [#503][bug #503] disable utilities when reload a source. 2.0.233
|
||||||
* v2.0, 2017-01-22, for [#752][bug #752] release the io then free it for kbps. 2.0.232
|
* v2.0, 2017-01-22, for [#752][bug #752] release the io then free it for kbps. 2.0.232
|
||||||
* v2.0, 2017-01-18, fix [#750][bug #750] use specific error code for dns resolve. 2.0.231
|
* v2.0, 2017-01-18, fix [#750][bug #750] use specific error code for dns resolve. 2.0.231
|
||||||
* <strong>v2.0, 2017-01-18, [2.0 beta4(2.0.230)][r2.0b4] released. 86334 lines.</strong>
|
* <strong>v2.0, 2017-01-18, [2.0 beta4(2.0.230)][r2.0b4] released. 86334 lines.</strong>
|
||||||
|
@ -1374,6 +1375,7 @@ Winlin
|
||||||
[bug #749]: https://github.com/ossrs/srs/issues/749
|
[bug #749]: https://github.com/ossrs/srs/issues/749
|
||||||
[bug #750]: https://github.com/ossrs/srs/issues/750
|
[bug #750]: https://github.com/ossrs/srs/issues/750
|
||||||
[bug #752]: https://github.com/ossrs/srs/issues/752
|
[bug #752]: https://github.com/ossrs/srs/issues/752
|
||||||
|
[bug #503]: https://github.com/ossrs/srs/issues/503
|
||||||
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
|
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
|
||||||
|
|
||||||
[bug #735]: https://github.com/ossrs/srs/issues/735
|
[bug #735]: https://github.com/ossrs/srs/issues/735
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
dvr {
|
dvr {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
dvr {
|
dvr {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
dvr {
|
dvr {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid objs/edge.pid;
|
pid objs/edge.pid;
|
||||||
srs_log_file ./objs/edge.log;
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
cluster {
|
cluster {
|
||||||
mode remote;
|
mode remote;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935
|
listen 1935
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
cluster {
|
cluster {
|
||||||
mode remote;
|
mode remote;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
transcode {
|
transcode {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid ./objs/srs.master.pid;
|
pid ./objs/srs.master.pid;
|
||||||
srs_log_tank file;
|
daemon off;
|
||||||
srs_log_file ./objs/srs.master.log;
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
forward {
|
forward {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
listen 19350;
|
listen 19350;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid ./objs/srs.slave.pid;
|
pid ./objs/srs.slave.pid;
|
||||||
srs_log_tank file;
|
daemon off;
|
||||||
srs_log_file ./objs/srs.slave.log;
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
|
||||||
daemon off;
|
daemon off;
|
||||||
srs_log_tank console;
|
srs_log_tank console;
|
||||||
srs_log_level trace;
|
|
||||||
|
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
hds {
|
hds {
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
hls {
|
hls {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
listen 19351;
|
listen 19351;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid objs/srs.flv.19351.pid;
|
pid objs/srs.flv.19351.pid;
|
||||||
srs_log_file objs/srs.flv.19351.log;
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8081;
|
listen 8081;
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
listen 19352;
|
listen 19352;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid objs/srs.flv.19352.pid;
|
pid objs/srs.flv.19352.pid;
|
||||||
srs_log_file objs/srs.flv.19352.log;
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8082;
|
listen 8082;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
listen 1935
|
listen 1935
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
heartbeat {
|
heartbeat {
|
||||||
enabled on;
|
enabled on;
|
||||||
interval 9.3;
|
interval 9.3;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
srs_log_tank file;
|
daemon off;
|
||||||
srs_log_file ./objs/srs.log;
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
http_hooks {
|
http_hooks {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
ingest livestream {
|
ingest livestream {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
listen 19350;
|
listen 19350;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
pid objs/origin.pid;
|
daemon off;
|
||||||
srs_log_file ./objs/origin.log;
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
http_server {
|
http_server {
|
||||||
enabled on;
|
enabled on;
|
||||||
listen 8080;
|
listen 8080;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
stream_caster {
|
stream_caster {
|
||||||
enabled on;
|
enabled on;
|
||||||
caster mpegts_over_udp;
|
caster mpegts_over_udp;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
stream_caster {
|
stream_caster {
|
||||||
enabled on;
|
enabled on;
|
||||||
caster rtsp;
|
caster rtsp;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
tcp_nodelay on
|
tcp_nodelay on
|
||||||
min_latency on;
|
min_latency on;
|
||||||
|
|
|
@ -4,5 +4,7 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
security {
|
security {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
hls {
|
hls {
|
||||||
enabled on;
|
enabled on;
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
listen 1935;
|
listen 1935;
|
||||||
max_connections 1000;
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
vhost __defaultVhost__ {
|
vhost __defaultVhost__ {
|
||||||
}
|
}
|
||||||
vhost source.srs.com {
|
vhost source.srs.com {
|
||||||
|
|
|
@ -840,6 +840,7 @@ SrsOriginHub::SrsOriginHub(SrsSource* s)
|
||||||
{
|
{
|
||||||
source = s;
|
source = s;
|
||||||
req = NULL;
|
req = NULL;
|
||||||
|
is_active = false;
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HLS
|
#ifdef SRS_AUTO_HLS
|
||||||
hls = new SrsHls();
|
hls = new SrsHls();
|
||||||
|
@ -1141,11 +1142,15 @@ int SrsOriginHub::on_publish()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_active = true;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsOriginHub::on_unpublish()
|
void SrsOriginHub::on_unpublish()
|
||||||
{
|
{
|
||||||
|
is_active = false;
|
||||||
|
|
||||||
// destroy all forwarders
|
// destroy all forwarders
|
||||||
destroy_forwarders();
|
destroy_forwarders();
|
||||||
|
|
||||||
|
@ -1261,6 +1266,12 @@ int SrsOriginHub::on_reload_vhost_forward(string vhost)
|
||||||
|
|
||||||
// forwarders
|
// forwarders
|
||||||
destroy_forwarders();
|
destroy_forwarders();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = create_forwarders()) != ERROR_SUCCESS) {
|
if ((ret = create_forwarders()) != ERROR_SUCCESS) {
|
||||||
srs_error("create forwarders failed. ret=%d", ret);
|
srs_error("create forwarders failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1283,6 +1294,12 @@ int SrsOriginHub::on_reload_vhost_hls(string vhost)
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HLS
|
#ifdef SRS_AUTO_HLS
|
||||||
hls->on_unpublish();
|
hls->on_unpublish();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = hls->on_publish(true)) != ERROR_SUCCESS) {
|
if ((ret = hls->on_publish(true)) != ERROR_SUCCESS) {
|
||||||
srs_error("hls publish failed. ret=%d", ret);
|
srs_error("hls publish failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1305,6 +1322,12 @@ int SrsOriginHub::on_reload_vhost_hds(string vhost)
|
||||||
|
|
||||||
#ifdef SRS_AUTO_HDS
|
#ifdef SRS_AUTO_HDS
|
||||||
hds->on_unpublish();
|
hds->on_unpublish();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = hds->on_publish(req)) != ERROR_SUCCESS) {
|
if ((ret = hds->on_publish(req)) != ERROR_SUCCESS) {
|
||||||
srs_error("hds publish failed. ret=%d", ret);
|
srs_error("hds publish failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1329,6 +1352,11 @@ int SrsOriginHub::on_reload_vhost_dvr(string vhost)
|
||||||
// cleanup dvr
|
// cleanup dvr
|
||||||
dvr->on_unpublish();
|
dvr->on_unpublish();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
// reinitialize the dvr, update plan.
|
// reinitialize the dvr, update plan.
|
||||||
if ((ret = dvr->initialize(this, req)) != ERROR_SUCCESS) {
|
if ((ret = dvr->initialize(this, req)) != ERROR_SUCCESS) {
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1358,6 +1386,12 @@ int SrsOriginHub::on_reload_vhost_transcode(string vhost)
|
||||||
|
|
||||||
#ifdef SRS_AUTO_TRANSCODE
|
#ifdef SRS_AUTO_TRANSCODE
|
||||||
encoder->on_unpublish();
|
encoder->on_unpublish();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
|
if ((ret = encoder->on_publish(req)) != ERROR_SUCCESS) {
|
||||||
srs_error("start encoder failed. ret=%d", ret);
|
srs_error("start encoder failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1379,6 +1413,12 @@ int SrsOriginHub::on_reload_vhost_exec(string vhost)
|
||||||
// TODO: FIXME: maybe should ignore when publish already stopped?
|
// TODO: FIXME: maybe should ignore when publish already stopped?
|
||||||
|
|
||||||
ng_exec->on_unpublish();
|
ng_exec->on_unpublish();
|
||||||
|
|
||||||
|
// Don't start forwarders when source is not active.
|
||||||
|
if (!is_active) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = ng_exec->on_publish(req)) != ERROR_SUCCESS) {
|
if ((ret = ng_exec->on_publish(req)) != ERROR_SUCCESS) {
|
||||||
srs_error("start exec failed. ret=%d", ret);
|
srs_error("start exec failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -421,6 +421,8 @@ class SrsOriginHub : public ISrsReloadHandler
|
||||||
private:
|
private:
|
||||||
SrsSource* source;
|
SrsSource* source;
|
||||||
SrsRequest* req;
|
SrsRequest* req;
|
||||||
|
// Whether the stream hub is active, or stream is publishing.
|
||||||
|
bool is_active;
|
||||||
private:
|
private:
|
||||||
// hls handler.
|
// hls handler.
|
||||||
#ifdef SRS_AUTO_HLS
|
#ifdef SRS_AUTO_HLS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue