diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-08 23:56:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-29 04:57:11 +0200 |
commit | e3e25777944eaa32847d71e68fd939f22d084f08 (patch) | |
tree | bc762a8084e29a96021d94571cad1ba44ed28fa7 | |
parent | 5bb347a3b4a88ce4c4de6d0a1dbb0e351cc326f6 (diff) | |
download | ffmpeg-e3e25777944eaa32847d71e68fd939f22d084f08.tar.gz |
ffserver: fix order of evaluation bugs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d40c0e4a6733ade9aaafc687bcaccc0cba1183b4)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffserver.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ffserver.c b/ffserver.c index e7fdfbece0..ab18d56397 100644 --- a/ffserver.c +++ b/ffserver.c @@ -562,9 +562,11 @@ static void start_multicast(void) default_port = 6000; for(stream = first_stream; stream != NULL; stream = stream->next) { if (stream->is_multicast) { + unsigned random0 = av_lfg_get(&random_state); + unsigned random1 = av_lfg_get(&random_state); /* open the RTP connection */ snprintf(session_id, sizeof(session_id), "%08x%08x", - av_lfg_get(&random_state), av_lfg_get(&random_state)); + random0, random1); /* choose a port if none given */ if (stream->multicast_port == 0) { @@ -3086,9 +3088,12 @@ static void rtsp_cmd_setup(HTTPContext *c, const char *url, found: /* generate session id if needed */ - if (h->session_id[0] == '\0') + if (h->session_id[0] == '\0') { + unsigned random0 = av_lfg_get(&random_state); + unsigned random1 = av_lfg_get(&random_state); snprintf(h->session_id, sizeof(h->session_id), "%08x%08x", - av_lfg_get(&random_state), av_lfg_get(&random_state)); + random0, random1); + } /* find rtp session, and create it if none found */ rtp_c = find_rtp_session(h->session_id); |