Commit 4c1202f7 authored by Martin Storsjö's avatar Martin Storsjö

Initialize ssrc and base_timestamp using ff_random_get_seed()

Originally committed as revision 22706 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9b1db5ec
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "avformat.h" #include "avformat.h"
#include "mpegts.h" #include "mpegts.h"
#include "internal.h" #include "internal.h"
#include "libavutil/random_seed.h"
#include <unistd.h> #include <unistd.h>
...@@ -79,11 +80,10 @@ static int rtp_write_header(AVFormatContext *s1) ...@@ -79,11 +80,10 @@ static int rtp_write_header(AVFormatContext *s1)
if (s->payload_type < 0) if (s->payload_type < 0)
s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == CODEC_TYPE_AUDIO); s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == CODEC_TYPE_AUDIO);
// following 2 FIXMEs could be set based on the current time, there is normally no info leak, as RTP will likely be transmitted immediately s->base_timestamp = ff_random_get_seed();
s->base_timestamp = 0; /* FIXME: was random(), what should this be? */
s->timestamp = s->base_timestamp; s->timestamp = s->base_timestamp;
s->cur_timestamp = 0; s->cur_timestamp = 0;
s->ssrc = 0; /* FIXME: was random(), what should this be? */ s->ssrc = ff_random_get_seed();
s->first_packet = 1; s->first_packet = 1;
s->first_rtcp_ntp_time = ff_ntp_time(); s->first_rtcp_ntp_time = ff_ntp_time();
if (s1->start_time_realtime) if (s1->start_time_realtime)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment