From 728fd55e0cc2a7800a1e5a852e186471154f3e39 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 4 Dec 2019 18:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=BB=B6?= =?UTF-8?q?=E5=90=8E=E5=BD=95=E5=88=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Record/Recorder.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Record/Recorder.cpp b/src/Record/Recorder.cpp index 4b95d08a..36cb8121 100644 --- a/src/Record/Recorder.cpp +++ b/src/Record/Recorder.cpp @@ -97,8 +97,7 @@ public: RecorderHelper(const MediaSinkInterface::Ptr &recorder, vector &&tracks , bool bContinueRecord, const string &schema) { _recorder = recorder; _continueRecord = bContinueRecord; - _schema = schema; - attachTracks(std::move(tracks)); + attachTracks(std::move(tracks),schema); } ~RecorderHelper() { @@ -106,12 +105,13 @@ public: } // 附则于track上 - void attachTracks(vector &&tracks){ + void attachTracks(vector &&tracks, const string &schema){ if(isTracksSame(tracks)){ return; } resetTracks(); _tracks = std::move(tracks); + _schema = schema; for (auto &track : _tracks) { _recorder->addTrack(track); track->addDelegate(_recorder); @@ -240,9 +240,9 @@ private: return; } - if(it->second->getSchema() == schema){ + if(!it->second->isRecording() || it->second->getSchema() == schema){ // 绑定的协议一致,替换tracks - it->second->attachTracks(std::move(tracks)); + it->second->attachTracks(std::move(tracks),schema); } }