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

RTC: Add callback for all consumers done

This commit is contained in:
winlin 2020-08-17 20:08:11 +08:00
parent 88d4314a3c
commit ab221fa842
4 changed files with 25 additions and 0 deletions

View file

@ -406,6 +406,11 @@ void SrsRtcStream::on_consumer_destroy(SrsRtcConsumer* consumer)
if (it != consumers.end()) {
consumers.erase(it);
}
// When all consumers finished, notify publisher to handle it.
if (publish_stream_ && consumers.empty()) {
publish_stream_->on_consumers_finished();
}
}
bool SrsRtcStream::can_publish()