aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-22 14:40:18 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-22 14:40:18 +0100
commit9774251c45eadfe0ba7b0381344451fa8840cc0d (patch)
treece925f2df91a1fe126c71c4ab23718a1fe3de5e5 /libavformat/rtpenc.c
parent73b59cc1bad802612d04c112844aab49953ede64 (diff)
downloadffmpeg-9774251c45eadfe0ba7b0381344451fa8840cc0d.tar.gz
rtpenc: do not use random values for seq when bitexact is requested.
Fixes fate Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpenc.c')
-rw-r--r--libavformat/rtpenc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 6d710043db..7adf687c7f 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -128,9 +128,12 @@ static int rtp_write_header(AVFormatContext *s1)
// Pick a random sequence start number, but in the lower end of the
// available range, so that any wraparound doesn't happen immediately.
// (Immediate wraparound would be an issue for SRTP.)
- if (s->seq < 0)
- s->seq = av_get_random_seed() & 0x0fff;
- else
+ if (s->seq < 0) {
+ if (st->codec->flags & CODEC_FLAG_BITEXACT) {
+ s->seq = 0;
+ } else
+ s->seq = av_get_random_seed() & 0x0fff;
+ } else
s->seq &= 0xffff; // Use the given parameter, wrapped to the right interval
if (s1->packet_size) {