changeset 1995:38e77ac19836 libavcodec

dont missuse assert()
author michael
date Fri, 30 Apr 2004 18:09:24 +0000
parents 8d3540dddd1b
children f481d3309ad0
files motion_est.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/motion_est.c	Fri Apr 30 17:42:58 2004 +0000
+++ b/motion_est.c	Fri Apr 30 18:09:24 2004 +0000
@@ -1002,7 +1002,10 @@
         c->stride<<=1;
         c->uvstride<<=1;
         
-        assert(s->flags & CODEC_FLAG_INTERLACED_ME);
+        if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
+            av_log(s->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
+            return -1;
+        }
 
         if(USES_LIST(mb_type, 0)){
             int field_select0= p->ref_index[0][xy ];
@@ -1060,7 +1063,10 @@
         c->stride>>=1;
         c->uvstride>>=1;
     }else if(IS_8X8(mb_type)){
-        assert(s->flags & CODEC_FLAG_4MV);
+        if(!(s->flags & CODEC_FLAG_4MV)){
+            av_log(s->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
+            return -1;
+        }
         cmpf= s->dsp.sse[1];
         chroma_cmpf= s->dsp.sse[1];
         init_mv4_ref(s);