From b1859e33abc845f089d46d9153ac7646064663e8 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Thu, 28 Mar 2019 09:23:22 +0800 Subject: [PATCH] =?UTF-8?q?MediaPusher=E4=BD=BF=E7=94=A8=E5=BC=B1=E6=8C=87?= =?UTF-8?q?=E9=92=88=E4=BF=9D=E5=AD=98MediaSource?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Pusher/MediaPusher.cpp | 2 +- src/Pusher/MediaPusher.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Pusher/MediaPusher.cpp b/src/Pusher/MediaPusher.cpp index 16a08925..51f4c59a 100644 --- a/src/Pusher/MediaPusher.cpp +++ b/src/Pusher/MediaPusher.cpp @@ -46,7 +46,7 @@ MediaPusher::MediaPusher(const string &schema, MediaPusher::~MediaPusher() { } void MediaPusher::publish(const string &strUrl) { - _parser = PusherBase::createPusher(_src,strUrl); + _parser = PusherBase::createPusher(_src.lock(),strUrl); _parser->setOnShutdown(_shutdownCB); _parser->setOnPublished(_publishCB); _parser->mINI::operator=(*this); diff --git a/src/Pusher/MediaPusher.h b/src/Pusher/MediaPusher.h index 924a175d..7d127ef2 100644 --- a/src/Pusher/MediaPusher.h +++ b/src/Pusher/MediaPusher.h @@ -49,9 +49,8 @@ public: virtual ~MediaPusher(); void publish(const string &strUrl) override; EventPoller::Ptr getPoller(); - private: - MediaSource::Ptr _src; + std::weak_ptr _src; }; } /* namespace mediakit */