1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix #2142, Async release bridger when unpublish. 4.0.60

This commit is contained in:
winlin 2021-01-14 19:12:01 +08:00
parent 10ffb2da36
commit 06adb9dc42
6 changed files with 60 additions and 5 deletions

View file

@ -51,6 +51,7 @@ using namespace std;
#include <srs_app_dash.hpp>
#include <srs_protocol_format.hpp>
#include <srs_app_rtc_source.hpp>
#include <srs_app_rtc_server.hpp>
#define CONST_MAX_JITTER_MS 250
#define CONST_MAX_JITTER_MS_NEG -250
@ -1881,10 +1882,13 @@ 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,
@ -1980,6 +1984,18 @@ void SrsSource::bridge_to(ISrsSourceBridger* v)
bridger = v;
}
void SrsSource::on_before_dispose(ISrsResource* c)
{
ISrsSourceBridger* pb = dynamic_cast<ISrsSourceBridger*>(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;