aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lau <jacklau1222@qq.com>2025-08-23 09:09:47 +0800
committerJack Lau <jacklau1222@qq.com>2025-08-23 17:20:32 +0800
commitb3ea5584929f16785cc45ad386998ff42fa72110 (patch)
tree30cf56dfada5b04bf74e829404da74cc75d744f2
parent673f28b6cb6e20f5a695a90d144a6158bdf987fe (diff)
downloadffmpeg-master.tar.gz
avformat/whip: fix ssrc might be sameHEADmaster
use audio_ssrc + 1 for video_ssrc to avoid ssrc collision See RFC 3550 Section 8, The SSRC identifier carried in the RTP header and in various fields of RTCP packets is a random 32 bit number that is required to be globally unique within an RTP session. simply + 1 also can get an unique ssrc, and faster than generating new unique ssrc. Signed-off-by: Jack Lau <jacklau1222@qq.com>
-rw-r--r--libavformat/whip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/whip.c b/libavformat/whip.c
index e2fa774c6f..69f1010ee8 100644
--- a/libavformat/whip.c
+++ b/libavformat/whip.c
@@ -577,7 +577,7 @@ static int generate_sdp_offer(AVFormatContext *s)
av_lfg_get(&whip->rnd));
whip->audio_ssrc = av_lfg_get(&whip->rnd);
- whip->video_ssrc = av_lfg_get(&whip->rnd);
+ whip->video_ssrc = whip->audio_ssrc + 1;
whip->audio_payload_type = WHIP_RTP_PAYLOAD_TYPE_OPUS;
whip->video_payload_type = WHIP_RTP_PAYLOAD_TYPE_H264;