确保静音音频track不影响后续添加的正常音频track

This commit is contained in:
ziyue 2021-09-27 13:27:07 +08:00
parent afec4b62b9
commit e20718fbde

View File

@ -46,6 +46,8 @@ 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;
_track_map[track_type] = track;
_track_ready_callback[track_type] = [this, track]() {
onTrackReady(track);