[FFmpeg-cvslog] ac3enc: use av_assert2() instead of assert() to make debugging easier.

Justin Ruggles git
Tue Mar 8 02:43:29 CET 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Fri Mar  4 12:11:03 2011 -0500| [e8a0c465bcd61875758c471a74ba9d678f04eca2] | committer: Michael Niedermayer

ac3enc: use av_assert2() instead of assert() to make debugging easier.
(cherry picked from commit 7100d63ca5edfc2e11c68201fb70d61a08a020cb)

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

 libavcodec/ac3enc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 676bb5e..833904f 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -27,8 +27,10 @@
  */
 
 //#define DEBUG
+//#define ASSERT_LEVEL 2
 
 #include "libavutil/audioconvert.h"
+#include "libavutil/avassert.h"
 #include "libavutil/crc.h"
 #include "avcodec.h"
 #include "put_bits.h"
@@ -1101,7 +1103,7 @@ static inline int sym_quant(int c, int e, int levels)
         v = (v + 1) >> 1;
         v = (levels >> 1) - v;
     }
-    assert(v >= 0 && v < levels);
+    av_assert2(v >= 0 && v < levels);
     return v;
 }
 
@@ -1123,7 +1125,7 @@ static inline int asym_quant(int c, int e, int qbits)
     m = (1 << (qbits-1));
     if (v >= m)
         v = m - 1;
-    assert(v >= -m);
+    av_assert2(v >= -m);
     return v & ((1 << qbits)-1);
 }
 
@@ -1439,7 +1441,7 @@ static void output_frame_end(AC3EncodeContext *s)
     flush_put_bits(&s->pb);
     frame = s->pb.buf;
     pad_bytes = s->frame_size - (put_bits_ptr(&s->pb) - frame) - 2;
-    assert(pad_bytes >= 0);
+    av_assert2(pad_bytes >= 0);
     if (pad_bytes > 0)
         memset(put_bits_ptr(&s->pb), 0, pad_bytes);
 




More information about the ffmpeg-cvslog mailing list