Commit 2b804514 by ziyue

修复mp4点播流线程安全检查失败bug

parent 5877d394
...@@ -111,9 +111,10 @@ void MP4Reader::startReadMP4(uint64_t sample_ms, bool ref_self, bool file_repeat ...@@ -111,9 +111,10 @@ void MP4Reader::startReadMP4(uint64_t sample_ms, bool ref_self, bool file_repeat
GET_CONFIG(uint32_t, sampleMS, Record::kSampleMS); GET_CONFIG(uint32_t, sampleMS, Record::kSampleMS);
auto strong_self = shared_from_this(); auto strong_self = shared_from_this();
if (_muxer) { if (_muxer) {
_muxer->setMediaListener(strong_self);
//一直读到所有track就绪为止 //一直读到所有track就绪为止
while (!_muxer->isAllTrackReady() && readNextSample()) {} while (!_muxer->isAllTrackReady() && readNextSample());
//注册后再切换OwnerPoller
_muxer->setMediaListener(strong_self);
} }
auto timer_sec = (sample_ms ? sample_ms : sampleMS) / 1000.0f; auto timer_sec = (sample_ms ? sample_ms : sampleMS) / 1000.0f;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论