mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
MP4点播绑定固定线程
This commit is contained in:
parent
7adddc361c
commit
4122084e05
@ -37,6 +37,7 @@ namespace mediakit {
|
|||||||
|
|
||||||
#ifdef ENABLE_MP4V2
|
#ifdef ENABLE_MP4V2
|
||||||
MediaReader::MediaReader(const string &strVhost,const string &strApp, const string &strId,const string &filePath ) {
|
MediaReader::MediaReader(const string &strVhost,const string &strApp, const string &strId,const string &filePath ) {
|
||||||
|
_poller = EventPollerPool::Instance().getPoller();
|
||||||
auto strFileName = filePath;
|
auto strFileName = filePath;
|
||||||
if(strFileName.empty()){
|
if(strFileName.empty()){
|
||||||
GET_CONFIG(string,recordPath,Record::kFilePath);
|
GET_CONFIG(string,recordPath,Record::kFilePath);
|
||||||
@ -164,7 +165,7 @@ void MediaReader::startReadMP4() {
|
|||||||
|
|
||||||
_timer = std::make_shared<Timer>(sampleMS / 1000.0f,[strongSelf](){
|
_timer = std::make_shared<Timer>(sampleMS / 1000.0f,[strongSelf](){
|
||||||
return strongSelf->readSample(0,false);
|
return strongSelf->readSample(0,false);
|
||||||
}, nullptr);
|
}, _poller);
|
||||||
|
|
||||||
//先读sampleMS毫秒的数据用于产生MediaSouce
|
//先读sampleMS毫秒的数据用于产生MediaSouce
|
||||||
readSample(sampleMS, false);
|
readSample(sampleMS, false);
|
||||||
|
@ -132,6 +132,7 @@ private:
|
|||||||
Ticker _alive;
|
Ticker _alive;
|
||||||
recursive_mutex _mtx;
|
recursive_mutex _mtx;
|
||||||
Timer::Ptr _timer;
|
Timer::Ptr _timer;
|
||||||
|
EventPoller::Ptr _poller;
|
||||||
#endif //ENABLE_MP4V2
|
#endif //ENABLE_MP4V2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user