Refine source cid, track previous one. 3.0.150

pull/2011/head
winlin 4 years ago
parent f08a1a1b10
commit bf5e2add83

@ -1132,8 +1132,8 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
// trigger edge to fetch from origin.
bool vhost_is_edge = _srs_config->get_vhost_is_edge(r->vhost);
srs_trace("flv: source url=%s, is_edge=%d, source_id=%d[%d]",
r->get_stream_url().c_str(), vhost_is_edge, s->source_id(), s->source_id());
srs_trace("flv: source url=%s, is_edge=%d, source_id=%d/%d",
r->get_stream_url().c_str(), vhost_is_edge, s->source_id(), s->pre_source_id());
return err;
}

@ -507,8 +507,8 @@ srs_error_t SrsRtmpConn::stream_service_cycle()
}
bool enabled_cache = _srs_config->get_gop_cache(req->vhost);
srs_trace("source url=%s, ip=%s, cache=%d, is_edge=%d, source_id=%d[%d]",
req->get_stream_url().c_str(), ip.c_str(), enabled_cache, info->edge, source->source_id(), source->source_id());
srs_trace("source url=%s, ip=%s, cache=%d, is_edge=%d, source_id=%d/%d",
req->get_stream_url().c_str(), ip.c_str(), enabled_cache, info->edge, source->source_id(), source->pre_source_id());
source->set_cache(enabled_cache);
switch (info->type) {

@ -515,7 +515,7 @@ srs_error_t SrsConsumer::dump_packets(SrsMessageArray* msgs, int& count)
count = 0;
if (should_update_source_id) {
srs_trace("update source_id=%d[%d]", source->source_id(), source->source_id());
srs_trace("update source_id=%d/%d", source->source_id(), source->pre_source_id());
should_update_source_id = false;
}
@ -1824,7 +1824,7 @@ SrsSource::SrsSource()
mix_queue = new SrsMixQueue();
_can_publish = true;
_pre_source_id = _source_id = -1;
_pre_source_id = _source_id = 0;
die_at = 0;
play_edge = new SrsPlayEdge();
@ -2022,13 +2022,10 @@ srs_error_t SrsSource::on_source_id_changed(int id)
if (_source_id == id) {
return err;
}
if (_pre_source_id == -1) {
if (!_pre_source_id) {
_pre_source_id = id;
} else if (_pre_source_id != _source_id) {
_pre_source_id = _source_id;
}
_source_id = id;
// notice all consumer
@ -2495,7 +2492,10 @@ void SrsSource::on_unpublish()
srs_trace("cleanup when unpublish");
_can_publish = true;
_source_id = -1;
if (_source_id) {
_pre_source_id = _source_id;
}
_source_id = 0;
// notify the handler.
srs_assert(handler);

Loading…
Cancel
Save