From de96a4f0c8381a0dc87a98b7f4927bb66365a1a0 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Thu, 28 May 2020 18:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpMediaSourceImp.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Rtmp/RtmpMediaSourceImp.h b/src/Rtmp/RtmpMediaSourceImp.h index d2a1267a..a779f30c 100644 --- a/src/Rtmp/RtmpMediaSourceImp.h +++ b/src/Rtmp/RtmpMediaSourceImp.h @@ -142,11 +142,6 @@ public: _muxer->addTrack(track); track->addDelegate(_muxer); } - - if(_recreate_metadata){ - //需要重新生成metadata - Metadata::addTrack(_metadata,track); - } } /** @@ -156,8 +151,11 @@ public: setTrackSource(_muxer); _all_track_ready = true; - if(_recreate_metadata){ + if (_recreate_metadata) { //更新metadata + for (auto &track : _muxer->getTracks()) { + Metadata::addTrack(_metadata, track); + } RtmpMediaSource::updateMetaData(_metadata); } }