mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
Merge remote-tracking branch 'github/master' into dev
This commit is contained in:
commit
f69a23565d
@ -1 +1 @@
|
|||||||
Subproject commit 9dac2536b1ee04e5cbfe78fe1d0e701b5b929a03
|
Subproject commit ea1da5cc85c48baa8ddf8c3c229b09cd9f5056cd
|
@ -521,6 +521,7 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
|
|||||||
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
||||||
if (size || totalReaderCount(sender)) {
|
if (size || totalReaderCount(sender)) {
|
||||||
//还有人观看该视频,不触发关闭事件
|
//还有人观看该视频,不触发关闭事件
|
||||||
|
_async_close_timer = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//没有任何人观看该视频源,表明该源可以关闭了
|
//没有任何人观看该视频源,表明该源可以关闭了
|
||||||
|
@ -307,7 +307,11 @@ void MultiMediaSourceMuxer::setTrackListener(const std::weak_ptr<MultiMuxerPriva
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MultiMediaSourceMuxer::totalReaderCount() const {
|
int MultiMediaSourceMuxer::totalReaderCount() const {
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
return _muxer->totalReaderCount() + _rtp_sender.size();
|
||||||
|
#else
|
||||||
return _muxer->totalReaderCount();
|
return _muxer->totalReaderCount();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiMediaSourceMuxer::setTimeStamp(uint32_t stamp) {
|
void MultiMediaSourceMuxer::setTimeStamp(uint32_t stamp) {
|
||||||
@ -358,6 +362,10 @@ void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const string &dst_
|
|||||||
|
|
||||||
bool MultiMediaSourceMuxer::stopSendRtp(MediaSource &sender, const string& ssrc){
|
bool MultiMediaSourceMuxer::stopSendRtp(MediaSource &sender, const string& ssrc){
|
||||||
#if defined(ENABLE_RTPPROXY)
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
onceToken token(nullptr, [&]() {
|
||||||
|
//关闭rtp推流,可能触发无人观看事件
|
||||||
|
MediaSourceEventInterceptor::onReaderChanged(sender, totalReaderCount());
|
||||||
|
});
|
||||||
if (ssrc.empty()) {
|
if (ssrc.empty()) {
|
||||||
//关闭全部
|
//关闭全部
|
||||||
lock_guard<mutex> lck(_rtp_sender_mtx);
|
lock_guard<mutex> lck(_rtp_sender_mtx);
|
||||||
|
Loading…
Reference in New Issue
Block a user