优化代码

This commit is contained in:
xiongziliang 2019-06-10 12:33:45 +08:00
parent 307321a380
commit c876c43374
3 changed files with 10 additions and 10 deletions

View File

@ -158,6 +158,14 @@ public:
}
return listener->close(*this,force);
}
void onNoneReader(){
auto listener = _listener.lock();
if(!listener){
return;
}
listener->onNoneReader(*this);
}
virtual void setListener(const std::weak_ptr<MediaSourceEvent> &listener){
_listener = listener;
}

View File

@ -141,11 +141,7 @@ private:
GET_CONFIG(int,stream_none_reader_delay,General::kStreamNoneReaderDelayMS);
if(_asyncEmitNoneReader && _readerTicker.elapsedTime() > stream_none_reader_delay){
_asyncEmitNoneReader = false;
auto listener = _listener.lock();
if(!listener){
return;
}
listener->onNoneReader(*this);
onNoneReader();
}
}
protected:

View File

@ -162,11 +162,7 @@ private:
GET_CONFIG(int,stream_none_reader_delay,General::kStreamNoneReaderDelayMS);
if(_asyncEmitNoneReader && _readerTicker.elapsedTime() > stream_none_reader_delay){
_asyncEmitNoneReader = false;
auto listener = _listener.lock();
if(!listener){
return;
}
listener->onNoneReader(*this);
onNoneReader();
}
}
protected: