From c493f0da1bb18811a2a42d10b09554de8dc2aadb Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Mon, 27 Sep 2021 14:12:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B7=BB=E5=8A=A0=E9=9D=99?= =?UTF-8?q?=E9=9F=B3=E9=9F=B3=E9=A2=91=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MediaSink.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Common/MediaSink.cpp b/src/Common/MediaSink.cpp index 0e8ee018..3c298d1f 100644 --- a/src/Common/MediaSink.cpp +++ b/src/Common/MediaSink.cpp @@ -46,8 +46,10 @@ bool MediaSink::addTrack(const Track::Ptr &track_in) { //克隆Track,只拷贝其数据,不拷贝其数据转发关系 auto track = track_in->clone(); auto track_type = track->getTrackType(); - //确保添加非静音音频track时,取消之前的静音音频track - _mute_audio_maker = nullptr; + if (track_type == TrackAudio) { + //确保添加非静音音频track时,取消之前的静音音频track + _mute_audio_maker = nullptr; + } _track_map[track_type] = track; _track_ready_callback[track_type] = [this, track]() { onTrackReady(track);