diff options
author | Jack Lau <jacklau1222@qq.com> | 2025-08-23 09:09:47 +0800 |
---|---|---|
committer | Jack Lau <jacklau1222@qq.com> | 2025-08-23 17:20:32 +0800 |
commit | b3ea5584929f16785cc45ad386998ff42fa72110 (patch) | |
tree | 30cf56dfada5b04bf74e829404da74cc75d744f2 | |
parent | 673f28b6cb6e20f5a695a90d144a6158bdf987fe (diff) | |
download | ffmpeg-master.tar.gz |
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.c | 2 |
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; |