Skip to content

Commit fd3fecc

Browse files
committed
avformat/whip: skip the unmatch nack packet through ssrc
Signed-off-by: Jack Lau <jacklau1222gm@gmail.com>
1 parent 5639215 commit fd3fecc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libavformat/whip.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ static void handle_nack_rtx(AVFormatContext *s, int size)
19531953
WHIPContext *whip = s->priv_data;
19541954
uint8_t *buf = NULL;
19551955
int rtcp_len, srtcp_len, header_len = 12/*RFC 4585 6.1*/;
1956+
uint32_t ssrc;
19561957

19571958
/**
19581959
* Refer to RFC 3550 6.4.1
@@ -1977,6 +1978,13 @@ static void handle_nack_rtx(AVFormatContext *s, int size)
19771978
av_log(whip, AV_LOG_WARNING, "NACK packet decrypt failed: %d\n", ret);
19781979
goto error;
19791980
}
1981+
ssrc = AV_RB32(&buf[8]);
1982+
if (ssrc != whip->video_ssrc) {
1983+
av_log(whip, AV_LOG_TRACE,
1984+
"NACK packet SSRC: %"PRIu32" not match with video track SSRC: %"PRIu32"\n",
1985+
ssrc, whip->video_ssrc);
1986+
goto end;
1987+
}
19801988
while (header_len + i + 4 <= rtcp_len) {
19811989
/**
19821990
* See https://datatracker.ietf.org/doc/html/rfc4585#section-6.1

0 commit comments

Comments
 (0)