|
|
|
@ -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);
|
|
|
|
|