mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
添加rtsp推流器
整理代码
This commit is contained in:
@@ -114,7 +114,7 @@ bool HLSMaker::write_index_file(int iFirstSegment, unsigned int uiLastSegment, i
|
||||
sizeof(acWriteBuf),
|
||||
"#EXTINF:%.3f,\r\n%s-%u.ts\r\n",
|
||||
_iDurations[i-iFirstSegment]/1000.0,
|
||||
_strFileName.c_str(),
|
||||
_strFileName.data(),
|
||||
i);
|
||||
if (fwrite(acWriteBuf, strlen(acWriteBuf), 1, pM3u8File.get()) != 1) {
|
||||
WarnL << "Could not write to m3u8 index file, will not continue writing to index file";
|
||||
|
||||
@@ -127,7 +127,7 @@ MediaReader::MediaReader(const string &strVhost,const string &strApp, const stri
|
||||
}
|
||||
|
||||
_iDuration = MAX(_video_ms,_audio_ms);
|
||||
_mediaMuxer.reset(new MultiMediaSourceMuxer(strVhost.data(),strApp.data(),strId.data(),_iDuration/1000.0,false, false));
|
||||
_mediaMuxer.reset(new MultiMediaSourceMuxer(strVhost,strApp,strId,_iDuration/1000.0,false, false));
|
||||
if (_audio_trId != MP4_INVALID_TRACK_ID) {
|
||||
AACTrack::Ptr track = std::make_shared<AACTrack>(_strAacCfg);
|
||||
_mediaMuxer->addTrack(track);
|
||||
|
||||
@@ -93,7 +93,7 @@ void TSMaker::flush() {
|
||||
bool TSMaker::init(const string& filename, uint32_t bufsize) {
|
||||
m_strFilename = filename;
|
||||
if (m_pOutVideoTs == NULL) {
|
||||
m_pOutVideoTs = File::createfile_file(filename.c_str(), "wb");
|
||||
m_pOutVideoTs = File::createfile_file(filename.data(), "wb");
|
||||
if (m_pOutVideoTs == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user