mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复hls流注销时相关bug:#2082
This commit is contained in:
parent
a37268f003
commit
b54f50c7c0
@ -70,6 +70,7 @@ MediaSource::MediaSource(const string &schema, const string &vhost, const string
|
|||||||
_app = app;
|
_app = app;
|
||||||
_stream_id = stream_id;
|
_stream_id = stream_id;
|
||||||
_create_stamp = time(NULL);
|
_create_stamp = time(NULL);
|
||||||
|
_default_poller = EventPollerPool::Instance().getPoller();
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaSource::~MediaSource() {
|
MediaSource::~MediaSource() {
|
||||||
@ -234,7 +235,8 @@ toolkit::EventPoller::Ptr MediaSource::getOwnerPoller() {
|
|||||||
if (listener) {
|
if (listener) {
|
||||||
return listener->getOwnerPoller(*this);
|
return listener->getOwnerPoller(*this);
|
||||||
}
|
}
|
||||||
throw std::runtime_error(toolkit::demangle(typeid(*this).name()) + "::getOwnerPoller failed:" + getUrl());
|
WarnL << toolkit::demangle(typeid(*this).name()) + "::getOwnerPoller failed, now return default poller: " + getUrl();
|
||||||
|
return _default_poller;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MediaSource::onReaderChanged(int size) {
|
void MediaSource::onReaderChanged(int size) {
|
||||||
|
@ -321,6 +321,7 @@ private:
|
|||||||
std::string _app;
|
std::string _app;
|
||||||
std::string _stream_id;
|
std::string _stream_id;
|
||||||
std::weak_ptr<MediaSourceEvent> _listener;
|
std::weak_ptr<MediaSourceEvent> _listener;
|
||||||
|
toolkit::EventPoller::Ptr _default_poller;
|
||||||
// 对象个数统计
|
// 对象个数统计
|
||||||
toolkit::ObjectStatistic<MediaSource> _statistic;
|
toolkit::ObjectStatistic<MediaSource> _statistic;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user