# HG changeset patch # User michael # Date 1268407305 0 # Node ID 2e9cf41e2c2e53fd72c0e40bd2bec9a5e4055d0a # Parent 1f170baf606f1e870670bd58261d775471695ee1 Always reset slice_table. Previously, the area of a lost slice would be left at the slice number of the previous frame which could occasionally match the number of the next slice and thus a non existing slice could have been used for prediction leading to additional decoding errors in otherwise undamaged slices. diff -r 1f170baf606f -r 2e9cf41e2c2e h264.c --- a/h264.c Fri Mar 12 12:26:47 2010 +0000 +++ b/h264.c Fri Mar 12 15:21:45 2010 +0000 @@ -961,8 +961,7 @@ if(!h->thread_context[i]->s.obmc_scratchpad) h->thread_context[i]->s.obmc_scratchpad = av_malloc(16*2*s->linesize + 8*2*s->uvlinesize); - /* some macroblocks will be accessed before they're available */ - if(FRAME_MBAFF || s->avctx->thread_count > 1) + /* some macroblocks can be accessed before they're available in case of lost slices, mbaff or threading*/ memset(h->slice_table, -1, (s->mb_height*s->mb_stride-1) * sizeof(*h->slice_table)); // s->decode= (s->flags&CODEC_FLAG_PSNR) || !s->encoding || s->current_picture.reference /*|| h->contains_intra*/ || 1;