Skip to content

Commit

Permalink
update for utest
Browse files Browse the repository at this point in the history
  • Loading branch information
runner365 committed Aug 1, 2023
1 parent 6c92871 commit 51c4d56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_rtc_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,7 @@ srs_error_t SrsRtcSendTrack::send_rtcp_sr(int64_t now_ms) {
SrsBuffer buffer(data, sr->nb_bytes());
sr->encode(&buffer);
delete sr;
sr = nullptr;
sr = NULL;

session_->send_rtcp(buffer.data(), buffer.size());

Expand Down
7 changes: 4 additions & 3 deletions trunk/src/utest/srs_utest_rtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,15 +720,16 @@ VOID TEST(KernelRTCTest, NACKFetchRTPPacket)
track->rtp_queue_->set(pkt->header.get_sequence(), pkt);
}

int64_t now_ms = srs_update_system_time();
// If sequence not match, packet not found.
if (true) {
SrsRtpPacket* pkt = track->fetch_rtp_packet(10);
SrsRtpPacket* pkt = track->fetch_rtp_packet(10, now_ms);
EXPECT_TRUE(pkt == NULL);
}

// The sequence matched, we got the packet.
if (true) {
SrsRtpPacket* pkt = track->fetch_rtp_packet(100);
SrsRtpPacket* pkt = track->fetch_rtp_packet(100, now_ms);
EXPECT_TRUE(pkt != NULL);
}

Expand All @@ -740,7 +741,7 @@ VOID TEST(KernelRTCTest, NACKFetchRTPPacket)
EXPECT_TRUE(pkt != NULL);

// But the track requires exactly match, so it returns NULL.
pkt = track->fetch_rtp_packet(1100);
pkt = track->fetch_rtp_packet(1100, now_ms);
EXPECT_TRUE(pkt == NULL);
}
}
Expand Down

0 comments on commit 51c4d56

Please sign in to comment.