优化点播相关代码

This commit is contained in:
xiongziliang
2020-04-03 23:27:16 +08:00
parent ecf3847482
commit 6e5cd0345d
5 changed files with 25 additions and 50 deletions

View File

@@ -167,31 +167,4 @@ int MP4Reader::totalReaderCount(MediaSource &sender) {
}
} /* namespace mediakit */
#endif //ENABLE_MP4
namespace mediakit {
MediaSource::Ptr onMakeMediaSource(const string &strSchema,
const string &strVhost,
const string &strApp,
const string &strId,
const string &filePath,
bool checkApp) {
#ifdef ENABLE_MP4
GET_CONFIG(string, appName, Record::kAppName);
if (checkApp && strApp != appName) {
return nullptr;
}
try {
MP4Reader::Ptr pReader(new MP4Reader(strVhost, strApp, strId, filePath));
pReader->startReadMP4();
return MediaSource::find(strSchema, strVhost, strApp, strId, false);
} catch (std::exception &ex) {
WarnL << ex.what();
return nullptr;
}
#else
return nullptr;
#endif //ENABLE_MP4
}
}//namespace mediakit
#endif //ENABLE_MP4