整理媒体事件相关代码,删除无须重载时的多余代码逻辑

This commit is contained in:
xiongzilaing
2022-08-28 17:25:56 +08:00
committed by ziyue
parent 67ad2a49c3
commit 679c79802f
23 changed files with 48 additions and 103 deletions

View File

@@ -592,7 +592,7 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
/////////////////////////////////////MediaSourceEvent//////////////////////////////////////
void MediaSourceEvent::onReaderChanged(MediaSource &sender, int size){
if (size || totalReaderCount(sender)) {
if (size || sender.totalReaderCount()) {
//还有人观看该视频,不触发关闭事件
_async_close_timer = nullptr;
return;
@@ -736,7 +736,6 @@ toolkit::EventPoller::Ptr MediaSourceEventInterceptor::getOwnerPoller(MediaSourc
return EventPollerPool::Instance().getPoller();
}
bool MediaSourceEventInterceptor::setupRecord(MediaSource &sender, Recorder::type type, bool start, const string &custom_path, size_t max_second) {
auto listener = _listener.lock();
if (!listener) {