完善线程安全设计

This commit is contained in:
xiongziliang
2022-08-27 10:17:06 +08:00
parent 8b0bd2d224
commit c2ab45f78d
15 changed files with 89 additions and 59 deletions

View File

@@ -576,8 +576,8 @@ MediaSource::Ptr MediaSource::createFromMP4(const string &schema, const string &
}
#ifdef ENABLE_MP4
try {
MP4Reader::Ptr pReader(new MP4Reader(vhost, app, stream, file_path));
pReader->startReadMP4();
auto reader = std::make_shared<MP4Reader>(vhost, app, stream, file_path);
reader->startReadMP4();
return MediaSource::find(schema, vhost, app, stream);
} catch (std::exception &ex) {
WarnL << ex.what();
@@ -733,7 +733,7 @@ toolkit::EventPoller::Ptr MediaSourceEventInterceptor::getOwnerPoller(MediaSourc
if (listener) {
return listener->getOwnerPoller(sender);
}
return nullptr;
return EventPollerPool::Instance().getPoller();
}