winlin

fix #736, recovery the hls dispose. 2.0.227

@@ -345,6 +345,7 @@ Remark: @@ -345,6 +345,7 @@ Remark:
345 345
346 ## History 346 ## History
347 347
  348 +* v2.0, 2017-01-11, fix [#736][bug #736], recovery the hls dispose. 2.0.227
348 * v2.0, 2017-01-10, refine hls html5 video template. 349 * v2.0, 2017-01-10, refine hls html5 video template.
349 * v2.0, 2017-01-10, fix [#635][bug #635], hls support NonIDR(open gop). 2.0.226 350 * v2.0, 2017-01-10, fix [#635][bug #635], hls support NonIDR(open gop). 2.0.226
350 * v2.0, 2017-01-06, for [#730][bug #730], reset ack follow flash player rules. 2.0.225 351 * v2.0, 2017-01-06, for [#730][bug #730], reset ack follow flash player rules. 2.0.225
@@ -794,14 +794,9 @@ int SrsSource::cycle_all() @@ -794,14 +794,9 @@ int SrsSource::cycle_all()
794 { 794 {
795 int ret = ERROR_SUCCESS; 795 int ret = ERROR_SUCCESS;
796 796
797 - // TODO: FIXME: support source cleanup.  
798 - // @see https://github.com/ossrs/srs/issues/713  
799 - // @see https://github.com/ossrs/srs/issues/714  
800 -#if 0  
801 int cid = _srs_context->get_id(); 797 int cid = _srs_context->get_id();
802 ret = do_cycle_all(); 798 ret = do_cycle_all();
803 _srs_context->set_id(cid); 799 _srs_context->set_id(cid);
804 -#endif  
805 800
806 return ret; 801 return ret;
807 } 802 }
@@ -813,10 +808,17 @@ int SrsSource::do_cycle_all() @@ -813,10 +808,17 @@ int SrsSource::do_cycle_all()
813 std::map<std::string, SrsSource*>::iterator it; 808 std::map<std::string, SrsSource*>::iterator it;
814 for (it = pool.begin(); it != pool.end();) { 809 for (it = pool.begin(); it != pool.end();) {
815 SrsSource* source = it->second; 810 SrsSource* source = it->second;
  811 +
  812 + // Do cycle source to cleanup components, such as hls dispose.
816 if ((ret = source->cycle()) != ERROR_SUCCESS) { 813 if ((ret = source->cycle()) != ERROR_SUCCESS) {
817 return ret; 814 return ret;
818 } 815 }
819 816
  817 + // TODO: FIXME: support source cleanup.
  818 + // @see https://github.com/ossrs/srs/issues/713
  819 + // @see https://github.com/ossrs/srs/issues/714
  820 +#if 0
  821 + // When source expired, remove it.
820 if (source->expired()) { 822 if (source->expired()) {
821 int cid = source->source_id(); 823 int cid = source->source_id();
822 if (cid == -1 && source->pre_source_id() > 0) { 824 if (cid == -1 && source->pre_source_id() > 0) {
@@ -832,6 +834,9 @@ int SrsSource::do_cycle_all() @@ -832,6 +834,9 @@ int SrsSource::do_cycle_all()
832 } else { 834 } else {
833 ++it; 835 ++it;
834 } 836 }
  837 +#else
  838 + ++it;
  839 +#endif
835 } 840 }
836 841
837 return ret; 842 return ret;
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 // current release version 31 // current release version
32 #define VERSION_MAJOR 2 32 #define VERSION_MAJOR 2
33 #define VERSION_MINOR 0 33 #define VERSION_MINOR 0
34 -#define VERSION_REVISION 226 34 +#define VERSION_REVISION 227
35 35
36 // generated by configure, only macros. 36 // generated by configure, only macros.
37 #include <srs_auto_headers.hpp> 37 #include <srs_auto_headers.hpp>