|
|
|
@ -800,8 +800,6 @@ int SrsSource::cycle_all()
|
|
|
|
|
{
|
|
|
|
|
int ret = ERROR_SUCCESS;
|
|
|
|
|
|
|
|
|
|
// TODO: FIXME: support source cleanup.
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/714
|
|
|
|
|
int cid = _srs_context->get_id();
|
|
|
|
|
ret = do_cycle_all();
|
|
|
|
|
_srs_context->set_id(cid);
|
|
|
|
@ -816,10 +814,17 @@ int SrsSource::do_cycle_all()
|
|
|
|
|
std::map<std::string, SrsSource*>::iterator it;
|
|
|
|
|
for (it = pool.begin(); it != pool.end();) {
|
|
|
|
|
SrsSource* source = it->second;
|
|
|
|
|
|
|
|
|
|
// Do cycle source to cleanup components, such as hls dispose.
|
|
|
|
|
if ((ret = source->cycle()) != ERROR_SUCCESS) {
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO: FIXME: support source cleanup.
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/713
|
|
|
|
|
// @see https://github.com/ossrs/srs/issues/714
|
|
|
|
|
#if 0
|
|
|
|
|
// When source expired, remove it.
|
|
|
|
|
if (source->expired()) {
|
|
|
|
|
int cid = source->source_id();
|
|
|
|
|
if (cid == -1 && source->pre_source_id() > 0) {
|
|
|
|
@ -835,6 +840,9 @@ int SrsSource::do_cycle_all()
|
|
|
|
|
} else {
|
|
|
|
|
++it;
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
++it;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|