From 4122084e0535e682a5102cbd249d74a73b1d97f4 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Thu, 11 Jul 2019 14:51:40 +0800 Subject: [PATCH] =?UTF-8?q?MP4=E7=82=B9=E6=92=AD=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E7=BA=BF=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MediaFile/MediaReader.cpp | 3 ++- src/MediaFile/MediaReader.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MediaFile/MediaReader.cpp b/src/MediaFile/MediaReader.cpp index 3d2b7e22..03048df9 100644 --- a/src/MediaFile/MediaReader.cpp +++ b/src/MediaFile/MediaReader.cpp @@ -37,6 +37,7 @@ namespace mediakit { #ifdef ENABLE_MP4V2 MediaReader::MediaReader(const string &strVhost,const string &strApp, const string &strId,const string &filePath ) { + _poller = EventPollerPool::Instance().getPoller(); auto strFileName = filePath; if(strFileName.empty()){ GET_CONFIG(string,recordPath,Record::kFilePath); @@ -164,7 +165,7 @@ void MediaReader::startReadMP4() { _timer = std::make_shared(sampleMS / 1000.0f,[strongSelf](){ return strongSelf->readSample(0,false); - }, nullptr); + }, _poller); //先读sampleMS毫秒的数据用于产生MediaSouce readSample(sampleMS, false); diff --git a/src/MediaFile/MediaReader.h b/src/MediaFile/MediaReader.h index 8b5dac5c..a2917367 100644 --- a/src/MediaFile/MediaReader.h +++ b/src/MediaFile/MediaReader.h @@ -132,6 +132,7 @@ private: Ticker _alive; recursive_mutex _mtx; Timer::Ptr _timer; + EventPoller::Ptr _poller; #endif //ENABLE_MP4V2 };