mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
优化代码
This commit is contained in:
parent
307321a380
commit
c876c43374
@ -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;
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user