avcodec/dvdec: only attempt to conceal errors based on STA inconsistencies when error_concealment is set

This allows the user to disable it in the hypothetical case that STA values are wrong

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-07-25 15:19:41 +02:00
parent bbad3811cc
commit 38490e0724
1 changed files with 8 additions and 6 deletions

View File

@ -311,12 +311,14 @@ retry:
for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {
/* skip header */
quant = buf_ptr[3] & 0x0f;
if ((buf_ptr[3] >> 4) == 0x0E)
vs_bit_buffer_damaged = 1;
if (!mb_index) {
sta = buf_ptr[3] >> 4;
} else if (sta != (buf_ptr[3] >> 4))
vs_bit_buffer_damaged = 1;
if (avctx->error_concealment) {
if ((buf_ptr[3] >> 4) == 0x0E)
vs_bit_buffer_damaged = 1;
if (!mb_index) {
sta = buf_ptr[3] >> 4;
} else if (sta != (buf_ptr[3] >> 4))
vs_bit_buffer_damaged = 1;
}
buf_ptr += 4;
init_put_bits(&pb, mb_bit_buffer, 80);
mb = mb1;