diff --git a/README.md b/README.md index 5cc643c3f..bdd34cbfc 100755 --- a/README.md +++ b/README.md @@ -155,7 +155,6 @@ For previous versions, please read: ## V4 changes -* v4.0, 2021-01-14, For [#2142][bug #2142], Async release bridger when unpublish. 4.0.60 * v4.0, 2021-01-08, HTML5 video tag resolution adaptive. 4.0.59 * v4.0, 2021-01-08, Fix memory leak and bugs for RTC. 4.0.58 * v4.0, 2021-01-06, Merge #2109, Refine srs_string_split. @@ -1796,7 +1795,6 @@ Winlin [bug #1987]: https://github.com/ossrs/srs/issues/1987 [bug #1548]: https://github.com/ossrs/srs/issues/1548 [bug #1694]: https://github.com/ossrs/srs/issues/1694 -[bug #2142]: https://github.com/ossrs/srs/issues/2142 [bug #yyyyyyyyyyyyy]: https://github.com/ossrs/srs/issues/yyyyyyyyyyyyy [bug #1631]: https://github.com/ossrs/srs/issues/1631 diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index d53a50751..39696a1ad 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #ifdef SRS_FFMPEG_FIT #include @@ -324,10 +323,8 @@ SrsRtcStream::~SrsRtcStream() consumers.clear(); srs_freep(req); + srs_freep(bridger_); srs_freep(stream_desc_); - - // Async remove the bridger, to notify the sources to clear it. - _srs_rtc_manager->remove(bridger_); } srs_error_t SrsRtcStream::initialize(SrsRequest* r) @@ -486,8 +483,7 @@ void SrsRtcStream::on_unpublish() // release unpublish stream description. set_stream_desc(NULL); - // Async remove the bridger, to notify the sources to clear it. - _srs_rtc_manager->remove(bridger_); + srs_freep(bridger_); // TODO: FIXME: Handle by statistic. } @@ -721,16 +717,6 @@ srs_error_t SrsRtcFromRtmpBridger::on_audio(SrsSharedPtrMessage* msg) return err; } -const SrsContextId& SrsRtcFromRtmpBridger::get_id() -{ - return _srs_context->get_id(); -} - -std::string SrsRtcFromRtmpBridger::desc() -{ - return "Rtmp2Rtc"; -} - srs_error_t SrsRtcFromRtmpBridger::transcode(char* adts_audio, int nn_adts_audio) { srs_error_t err = srs_success; @@ -1189,16 +1175,6 @@ void SrsRtcDummyBridger::on_unpublish() { } -const SrsContextId& SrsRtcDummyBridger::get_id() -{ - return _srs_context->get_id(); -} - -std::string SrsRtcDummyBridger::desc() -{ - return "Rtmp2RtcDummy"; -} - SrsCodecPayload::SrsCodecPayload() { pt_of_publisher_ = pt_ = 0; diff --git a/trunk/src/app/srs_app_rtc_source.hpp b/trunk/src/app/srs_app_rtc_source.hpp index f6ed07562..e2b7d5f2b 100644 --- a/trunk/src/app/srs_app_rtc_source.hpp +++ b/trunk/src/app/srs_app_rtc_source.hpp @@ -247,10 +247,6 @@ public: virtual srs_error_t on_publish(); virtual void on_unpublish(); virtual srs_error_t on_audio(SrsSharedPtrMessage* msg); -// interface ISrsResource -public: - virtual const SrsContextId& get_id(); - virtual std::string desc(); private: srs_error_t transcode(char* adts_audio, int nn_adts_audio); srs_error_t package_opus(char* data, int size, SrsRtpPacket2** ppkt); @@ -276,10 +272,6 @@ public: virtual srs_error_t on_audio(SrsSharedPtrMessage* audio); virtual srs_error_t on_video(SrsSharedPtrMessage* video); virtual void on_unpublish(); -// interface ISrsResource -public: - virtual const SrsContextId& get_id(); - virtual std::string desc(); }; // TODO: FIXME: Rename it. diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index 0d952e003..3d317eb2d 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -51,7 +51,6 @@ using namespace std; #include #include #include -#include #define CONST_MAX_JITTER_MS 250 #define CONST_MAX_JITTER_MS_NEG -250 @@ -1882,13 +1881,10 @@ SrsSource::SrsSource() _srs_config->subscribe(this); atc = false; - - _srs_rtc_manager->subscribe(this); } SrsSource::~SrsSource() { - _srs_rtc_manager->unsubscribe(this); _srs_config->unsubscribe(this); // never free the consumers, @@ -1984,18 +1980,6 @@ void SrsSource::bridge_to(ISrsSourceBridger* v) bridger = v; } -void SrsSource::on_before_dispose(ISrsResource* c) -{ - ISrsSourceBridger* pb = dynamic_cast(c); - if (bridger == pb) { - bridge_to(NULL); - } -} - -void SrsSource::on_disposing(ISrsResource* c) -{ -} - srs_error_t SrsSource::on_reload_vhost_play(string vhost) { srs_error_t err = srs_success; diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index 652e0c14d..4a58eb954 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -34,7 +34,6 @@ #include #include #include -#include class SrsFormat; class SrsRtmpFormat; @@ -485,7 +484,7 @@ public: extern SrsSourceManager* _srs_sources; // For two sources to bridge with each other. -class ISrsSourceBridger : public ISrsResource +class ISrsSourceBridger { public: ISrsSourceBridger(); @@ -498,7 +497,7 @@ public: }; // live streaming source. -class SrsSource : virtual public ISrsReloadHandler, virtual public ISrsDisposingHandler +class SrsSource : public ISrsReloadHandler { friend class SrsOriginHub; private: @@ -560,10 +559,6 @@ public: virtual srs_error_t initialize(SrsRequest* r, ISrsSourceHandler* h); // Bridge to other source, forward packets to it. void bridge_to(ISrsSourceBridger* v); -// interface ISrsDisposingHandler -public: - virtual void on_before_dispose(ISrsResource* c); - virtual void on_disposing(ISrsResource* c); // Interface ISrsReloadHandler public: virtual srs_error_t on_reload_vhost_play(std::string vhost); diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 36f154c90..603d1bab4 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION4_HPP #define SRS_CORE_VERSION4_HPP -#define SRS_VERSION4_REVISION 60 +#define SRS_VERSION4_REVISION 59 #endif