Commit b54f50c7 by xiongziliang

修复hls流注销时相关bug:#2082

parent a37268f0
...@@ -70,6 +70,7 @@ MediaSource::MediaSource(const string &schema, const string &vhost, const string ...@@ -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() { ...@@ -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: ...@@ -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;
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论