完善添加静音音频相关功能

This commit is contained in:
ziyue 2021-09-27 14:12:11 +08:00
parent e20718fbde
commit c493f0da1b

View File

@ -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);