Revision 042819c5

View differences:

ffserver.c
35 35
#include "libavformat/rtpdec.h"
36 36
#include "libavformat/rtsp.h"
37 37
#include "libavutil/avstring.h"
38
#include "libavutil/random.h"
38
#include "libavutil/lfg.h"
39
#include "libavutil/random_seed.h"
39 40
#include "libavutil/intreadwrite.h"
40 41
#include "libavcodec/opt.h"
41 42
#include <stdarg.h>
......
309 310

  
310 311
static int64_t cur_time;           // Making this global saves on passing it around everywhere
311 312

  
312
static AVRandomState random_state;
313
static AVLFG random_state;
313 314

  
314 315
static FILE *logfile = NULL;
315 316

  
......
503 504
        if (stream->is_multicast) {
504 505
            /* open the RTP connection */
505 506
            snprintf(session_id, sizeof(session_id), "%08x%08x",
506
                     av_random(&random_state), av_random(&random_state));
507
                     av_lfg_get(&random_state), av_lfg_get(&random_state));
507 508

  
508 509
            /* choose a port if none given */
509 510
            if (stream->multicast_port == 0) {
......
1599 1600
    if (!strcmp(c->stream->fmt->name,"asf_stream")) {
1600 1601
        /* Need to allocate a client id */
1601 1602

  
1602
        c->wmp_client_id = av_random(&random_state) & 0x7fffffff;
1603
        c->wmp_client_id = av_lfg_get(&random_state);
1603 1604

  
1604 1605
        q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Server: Cougar 4.1.0.3923\r\nCache-Control: no-cache\r\nPragma: client-id=%d\r\nPragma: features=\"broadcast\"\r\n", c->wmp_client_id);
1605 1606
    }
......
2867 2868
    /* generate session id if needed */
2868 2869
    if (h->session_id[0] == '\0')
2869 2870
        snprintf(h->session_id, sizeof(h->session_id), "%08x%08x",
2870
                 av_random(&random_state), av_random(&random_state));
2871
                 av_lfg_get(&random_state), av_lfg_get(&random_state));
2871 2872

  
2872 2873
    /* find rtp session, and create it if none found */
2873 2874
    rtp_c = find_rtp_session(h->session_id);
......
4507 4508

  
4508 4509
    unsetenv("http_proxy");             /* Kill the http_proxy */
4509 4510

  
4510
    av_random_init(&random_state, av_gettime() + (getpid() << 16));
4511
    av_lfg_init(&random_state, ff_random_get_seed());
4511 4512

  
4512 4513
    memset(&sigact, 0, sizeof(sigact));
4513 4514
    sigact.sa_handler = handle_child_exit;

Also available in: Unified diff