Skip to content

Commit 890afb8

Browse files
committed
avformat/whip: fix whip->hist_head overflow
Signed-off-by: Jack Lau <[email protected]>
1 parent 5f688a1 commit 890afb8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

libavformat/whip.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,7 @@ static int setup_srtp(AVFormatContext *s)
14891489
it->size = size;
14901490
it->seq = AV_RB16(pkt + 2);
14911491

1492-
whip->hist_head++;
1492+
whip->hist_head = ++pos;
14931493
}
14941494

14951495
static const RtpHistoryItem* rtp_history_find(const WHIPContext *whip, uint16_t seq)
@@ -1551,8 +1551,9 @@ static int on_rtp_write_packet(void *opaque, const uint8_t *buf, int buf_size)
15511551
return ret;
15521552
}
15531553
/**
1554+
* See https://datatracker.ietf.org/doc/html/rfc4588
15541555
* Build and send a single RTX packet
1555-
*/
1556+
*/
15561557
static int send_rtx_packet(AVFormatContext *s, const uint8_t * orig_pkt, int orig_size)
15571558
{
15581559
WHIPContext * whip = s->priv_data;
@@ -1916,7 +1917,8 @@ static int whip_write_packet(AVFormatContext *s, AVPacket *pkt)
19161917
/**
19171918
* Handle RTCP NACK
19181919
* Refer to RFC 4585, Section 6.2.1
1919-
* The Generic NACK message is identified by PT=RTPFB and FMT=1.
1920+
* The Generic NACK message is identified by PT=RTPFB and FMT=1.
1921+
* TODO: disable retransmisstion when "-tune zerolatency"
19201922
*/
19211923
if (media_is_rtcp(whip->buf, ret)) {
19221924
int ptr = 0;

0 commit comments

Comments
 (0)