[FFmpeg-cvslog] rtpenc: do not use random values for seq when bitexact is requested.

Michael Niedermayer git at videolan.org
Tue Jan 22 14:47:39 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan 22 14:40:18 2013 +0100| [9774251c45eadfe0ba7b0381344451fa8840cc0d] | committer: Michael Niedermayer

rtpenc: do not use random values for seq when bitexact is requested.

Fixes fate

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9774251c45eadfe0ba7b0381344451fa8840cc0d
---

 libavformat/rtpenc.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 6d71004..7adf687 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) {



More information about the ffmpeg-cvslog mailing list