mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 11:17:09 +08:00
MediaPusher使用弱指针保存MediaSource
This commit is contained in:
parent
32da13114a
commit
b1859e33ab
@ -46,7 +46,7 @@ MediaPusher::MediaPusher(const string &schema,
|
|||||||
MediaPusher::~MediaPusher() {
|
MediaPusher::~MediaPusher() {
|
||||||
}
|
}
|
||||||
void MediaPusher::publish(const string &strUrl) {
|
void MediaPusher::publish(const string &strUrl) {
|
||||||
_parser = PusherBase::createPusher(_src,strUrl);
|
_parser = PusherBase::createPusher(_src.lock(),strUrl);
|
||||||
_parser->setOnShutdown(_shutdownCB);
|
_parser->setOnShutdown(_shutdownCB);
|
||||||
_parser->setOnPublished(_publishCB);
|
_parser->setOnPublished(_publishCB);
|
||||||
_parser->mINI::operator=(*this);
|
_parser->mINI::operator=(*this);
|
||||||
|
@ -49,9 +49,8 @@ public:
|
|||||||
virtual ~MediaPusher();
|
virtual ~MediaPusher();
|
||||||
void publish(const string &strUrl) override;
|
void publish(const string &strUrl) override;
|
||||||
EventPoller::Ptr getPoller();
|
EventPoller::Ptr getPoller();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MediaSource::Ptr _src;
|
std::weak_ptr<MediaSource> _src;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace mediakit */
|
} /* namespace mediakit */
|
||||||
|
Loading…
Reference in New Issue
Block a user