Skip to content

Commit

Permalink
fix #503, disable utilities when reload a source. 2.0.233
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Feb 9, 2017
1 parent 15570d9 commit 99bffea
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ Remark:

## History

* 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-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>
Expand Down Expand Up @@ -1285,6 +1286,7 @@ Winlin
[bug #749]: https://github.com/ossrs/srs/issues/749
[bug #750]: https://github.com/ossrs/srs/issues/750
[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

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
31 changes: 30 additions & 1 deletion trunk/src/app/srs_app_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,12 @@ int SrsSource::on_reload_vhost_forward(string vhost)

// forwarders
destroy_forwarders();

// Don't start forwarders when source is not active.
if (_can_publish) {
return ret;
}

if ((ret = create_forwarders()) != ERROR_SUCCESS) {
srs_error("create forwarders failed. ret=%d", ret);
return ret;
Expand All @@ -1247,6 +1253,12 @@ int SrsSource::on_reload_vhost_hls(string vhost)

#ifdef SRS_AUTO_HLS
hls->on_unpublish();

// Don't start forwarders when source is not active.
if (_can_publish) {
return ret;
}

if ((ret = hls->on_publish(_req, true)) != ERROR_SUCCESS) {
srs_error("hls publish failed. ret=%d", ret);
return ret;
Expand All @@ -1267,6 +1279,12 @@ int SrsSource::on_reload_vhost_hds(string vhost)

#ifdef SRS_AUTO_HDS
hds->on_unpublish();

// Don't start forwarders when source is not active.
if (_can_publish) {
return ret;
}

if ((ret = hds->on_publish(_req)) != ERROR_SUCCESS) {
srs_error("hds publish failed. ret=%d", ret);
return ret;
Expand All @@ -1288,7 +1306,12 @@ int SrsSource::on_reload_vhost_dvr(string vhost)
#ifdef SRS_AUTO_DVR
// cleanup dvr
dvr->on_unpublish();


// Don't start forwarders when source is not active.
if (_can_publish) {
return ret;
}

// reinitialize the dvr, update plan.
if ((ret = dvr->initialize(this, _req)) != ERROR_SUCCESS) {
return ret;
Expand Down Expand Up @@ -1316,6 +1339,12 @@ int SrsSource::on_reload_vhost_transcode(string vhost)

#ifdef SRS_AUTO_TRANSCODE
encoder->on_unpublish();

// Don't start forwarders when source is not active.
if (_can_publish) {
return ret;
}

if ((ret = encoder->on_publish(_req)) != ERROR_SUCCESS) {
srs_error("start encoder failed. ret=%d", ret);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 232
#define VERSION_REVISION 233

// generated by configure, only macros.
#include <srs_auto_headers.hpp>
Expand Down

0 comments on commit 99bffea

Please sign in to comment.