mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 08:39:34 +08:00
无人观看定时器指定为MediaSource对象所属poller以确保读取观看数是线程安全的
This commit is contained in:
parent
260b3ff02c
commit
3e62775db7
@ -581,7 +581,7 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
|
|||||||
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
|
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
|
||||||
|
|
||||||
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
||||||
if (size || totalReaderCount(sender)) {
|
if (size) {
|
||||||
//还有人观看该视频,不触发关闭事件
|
//还有人观看该视频,不触发关闭事件
|
||||||
_async_close_timer = nullptr;
|
_async_close_timer = nullptr;
|
||||||
return;
|
return;
|
||||||
@ -618,7 +618,7 @@ void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
|
|||||||
strong_sender->close(false);
|
strong_sender->close(false);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}, nullptr);
|
}, getOwnerPoller(sender));
|
||||||
}
|
}
|
||||||
|
|
||||||
string MediaSourceEvent::getOriginUrl(MediaSource &sender) const {
|
string MediaSourceEvent::getOriginUrl(MediaSource &sender) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user