changeset 6359:f8fe5baa8b47 libavformat

rtpenc_xiph: Clarify that num_frames shouldn't ever get larger than max_frames_per_packet
author mstorsjo
date Tue, 10 Aug 2010 08:37:19 +0000
parents 61e469c032b7
children 4f920c9dd895
files rtpenc_xiph.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rtpenc_xiph.c	Mon Aug 09 23:21:08 2010 +0000
+++ b/rtpenc_xiph.c	Tue Aug 10 08:37:19 2010 +0000
@@ -72,8 +72,9 @@
         uint8_t *ptr     = s->buf_ptr + 2 + size; // what we're going to write
         int remaining    = end_ptr - ptr;
 
+        assert(s->num_frames <= s->max_frames_per_packet);
         if ((s->num_frames > 0 && remaining < 0) ||
-            s->num_frames >= s->max_frames_per_packet) {
+            s->num_frames == s->max_frames_per_packet) {
             // send previous packets now; no room for new data
             ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0);
             s->num_frames = 0;