mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refien NACK code
This commit is contained in:
parent
f066686255
commit
f841e0c37a
1 changed files with 36 additions and 38 deletions
|
@ -580,9 +580,7 @@ srs_error_t SrsRtcPlayStream::send_packets(SrsRtcStream* source, const vector<Sr
|
|||
|
||||
void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, uint16_t seq)
|
||||
{
|
||||
if (true) {
|
||||
std::map<uint32_t, SrsRtcAudioSendTrack*>::iterator it;
|
||||
for (it = audio_tracks_.begin(); it != audio_tracks_.end(); ++it) {
|
||||
for (map<uint32_t, SrsRtcAudioSendTrack*>::iterator it = audio_tracks_.begin(); it != audio_tracks_.end(); ++it) {
|
||||
SrsRtcAudioSendTrack* track = it->second;
|
||||
|
||||
// If track is inactive, not process nack request.
|
||||
|
@ -590,7 +588,10 @@ void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, u
|
|||
continue;
|
||||
}
|
||||
|
||||
if (track->has_ssrc(ssrc)) {
|
||||
if (!track->has_ssrc(ssrc)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// update recv nack statistic
|
||||
track->on_recv_nack();
|
||||
|
||||
|
@ -600,12 +601,8 @@ void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, u
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (true) {
|
||||
std::map<uint32_t, SrsRtcVideoSendTrack*>::iterator it;
|
||||
for (it = video_tracks_.begin(); it != video_tracks_.end(); ++it) {
|
||||
for (map<uint32_t, SrsRtcVideoSendTrack*>::iterator it = video_tracks_.begin(); it != video_tracks_.end(); ++it) {
|
||||
SrsRtcVideoSendTrack* track = it->second;
|
||||
|
||||
// If track is inactive, not process nack request.
|
||||
|
@ -613,7 +610,10 @@ void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, u
|
|||
continue;
|
||||
}
|
||||
|
||||
if (track->has_ssrc(ssrc)) {
|
||||
if (!track->has_ssrc(ssrc)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// update recv nack statistic
|
||||
track->on_recv_nack();
|
||||
|
||||
|
@ -623,8 +623,6 @@ void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, u
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SrsRtcPlayStream::set_all_tracks_status(bool status)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue