From 2b804514e10d502f344a6ab85c457504b5c16dd2 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Tue, 1 Nov 2022 22:02:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmp4=E7=82=B9=E6=92=AD?= =?UTF-8?q?=E6=B5=81=E7=BA=BF=E7=A8=8B=E5=AE=89=E5=85=A8=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/MP4Reader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Record/MP4Reader.cpp b/src/Record/MP4Reader.cpp index 66160e9b..687072e0 100644 --- a/src/Record/MP4Reader.cpp +++ b/src/Record/MP4Reader.cpp @@ -111,9 +111,10 @@ void MP4Reader::startReadMP4(uint64_t sample_ms, bool ref_self, bool file_repeat GET_CONFIG(uint32_t, sampleMS, Record::kSampleMS); auto strong_self = shared_from_this(); if (_muxer) { - _muxer->setMediaListener(strong_self); //一直读到所有track就绪为止 - while (!_muxer->isAllTrackReady() && readNextSample()) {} + while (!_muxer->isAllTrackReady() && readNextSample()); + //注册后再切换OwnerPoller + _muxer->setMediaListener(strong_self); } auto timer_sec = (sample_ms ? sample_ms : sampleMS) / 1000.0f;