changeset 2357:30d8b99e00f3 libavcodec

reset ref_index
author michael
date Fri, 19 Nov 2004 13:08:25 +0000
parents def33a002b94
children 622a0b0f2d56
files error_resilience.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/error_resilience.c	Fri Nov 19 11:37:03 2004 +0000
+++ b/error_resilience.c	Fri Nov 19 13:08:25 2004 +0000
@@ -666,6 +666,8 @@
     int threshold_part[4]= {100,100,100};
     int threshold= 50;
     int is_intra_likely;
+    int size = s->b8_stride * 2 * s->mb_height;
+    Picture *pic= s->current_picture_ptr;
     
     if(!s->error_resilience || s->error_count==0 || 
        s->error_count==3*s->mb_width*(s->avctx->skip_top + s->avctx->skip_bottom)) return;
@@ -673,9 +675,6 @@
     av_log(s->avctx, AV_LOG_INFO, "concealing %d errors\n", s->error_count);
     
     if(s->current_picture.motion_val[0] == NULL){
-        int size = s->b8_stride * 2 * s->mb_height;
-        Picture *pic= s->current_picture_ptr;
-        
         av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
             
         for(i=0; i<2; i++){
@@ -687,6 +686,11 @@
         s->current_picture= *s->current_picture_ptr;
     }
     
+    for(i=0; i<2; i++){
+        if(pic->ref_index[i])
+            memset(pic->ref_index[i], 0, size * sizeof(uint8_t));
+    }
+
     if(s->avctx->debug&FF_DEBUG_ER){
         for(mb_y=0; mb_y<s->mb_height; mb_y++){
             for(mb_x=0; mb_x<s->mb_width; mb_x++){