[FFmpeg-cvslog] ffmenc: replace if/abort with assert()

Mans Rullgard git at videolan.org
Fri Aug 10 16:31:43 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Wed Aug  8 22:57:12 2012 +0100| [6d3783d16001810885603b39857d48bc84744ea2] | committer: Mans Rullgard

ffmenc: replace if/abort with assert()

The condition is trivially true, but keeping the assert() is
sensible to avoid FFM_HEADER_SIZE ever getting out of sync with
the actual code.

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 libavformat/ffmenc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index ab69267..8069309 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -19,6 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <assert.h>
+
 #include "libavutil/intreadwrite.h"
 #include "libavutil/intfloat.h"
 #include "avformat.h"
@@ -34,8 +36,7 @@ static void flush_packet(AVFormatContext *s)
     fill_size = ffm->packet_end - ffm->packet_ptr;
     memset(ffm->packet_ptr, 0, fill_size);
 
-    if (avio_tell(pb) % ffm->packet_size)
-        av_abort();
+    assert(avio_tell(pb) % ffm->packet_size == 0);
 
     /* put header */
     avio_wb16(pb, PACKET_ID);



More information about the ffmpeg-cvslog mailing list