mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
parent
4152dcd409
commit
f3e2a29cbd
@ -117,19 +117,17 @@ void MediaSink::checkTrackIfReady() {
|
|||||||
// 等待音频超时时间
|
// 等待音频超时时间
|
||||||
GET_CONFIG(uint32_t, kWaitAudioTrackDataMS, General::kWaitAudioTrackDataMS);
|
GET_CONFIG(uint32_t, kWaitAudioTrackDataMS, General::kWaitAudioTrackDataMS);
|
||||||
if (_max_track_size > 1) {
|
if (_max_track_size > 1) {
|
||||||
for (auto it = _track_map.begin(); it != _track_map.end(); ++it) {
|
for (auto it = _track_map.begin(); it != _track_map.end();) {
|
||||||
if (it->second.first->getTrackType() != TrackAudio) {
|
if (it->second.first->getTrackType() == TrackAudio && _ticker.elapsedTime() > kWaitAudioTrackDataMS && !it->second.second) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (_ticker.elapsedTime() > kWaitAudioTrackDataMS && !it->second.second) {
|
|
||||||
// 音频超时且完全没收到音频数据,忽略音频
|
// 音频超时且完全没收到音频数据,忽略音频
|
||||||
auto index = it->second.first->getIndex();
|
auto index = it->second.first->getIndex();
|
||||||
WarnL << "audio track " << "index " << index << " codec " << it->second.first->getCodecName() << " receive no data for long "
|
WarnL << "Audio track index " << index << " codec " << it->second.first->getCodecName() << " receive no data for long "
|
||||||
<< _ticker.elapsedTime() << "ms. Ignore it!";
|
<< _ticker.elapsedTime() << "ms. Ignore it!";
|
||||||
it = _track_map.erase(it);
|
it = _track_map.erase(it);
|
||||||
_max_track_size -= 1;
|
_max_track_size -= 1;
|
||||||
_track_ready_callback.erase(index);
|
_track_ready_callback.erase(index);
|
||||||
continue;
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user