MP4点播绑定固定线程

This commit is contained in:
xiongziliang 2019-07-11 14:51:40 +08:00
parent 7adddc361c
commit 4122084e05
2 changed files with 3 additions and 1 deletions

View File

@ -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<Timer>(sampleMS / 1000.0f,[strongSelf](){
return strongSelf->readSample(0,false);
}, nullptr);
}, _poller);
//先读sampleMS毫秒的数据用于产生MediaSouce
readSample(sampleMS, false);

View File

@ -132,6 +132,7 @@ private:
Ticker _alive;
recursive_mutex _mtx;
Timer::Ptr _timer;
EventPoller::Ptr _poller;
#endif //ENABLE_MP4V2
};