summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-11 16:40:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-11 17:30:02 +0100
commit855463c007719d8a9cddfa757a00ae5428b3dbde (patch)
treeb3fbc18aac19157e29c155dca03919348cbf97be /libavcodec/h264.c
parentcba199b5952feca4df39560d5c42cb7992e5d875 (diff)
avcodec/h264: Keep a reference to the last picture for EC
This and the next commit improve error concealment for green-block-artifacts-from-canon-100-hs.MOV Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f40449eb0a..b27e747d0b 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1838,6 +1838,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
* packets do not get used. */
h->data_partitioning = 0;
+ ff_h264_unref_picture(h, &h->last_pic_for_ec);
+
/* end of stream, output what is still in the buffers */
if (buf_size == 0) {
out:
@@ -1930,6 +1932,8 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
assert(pict->buf[0] || !*got_frame);
+ ff_h264_unref_picture(h, &h->last_pic_for_ec);
+
return get_consumed_bytes(buf_index, buf_size);
}
@@ -1954,6 +1958,7 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
ff_h264_free_context(h);
ff_h264_unref_picture(h, &h->cur_pic);
+ ff_h264_unref_picture(h, &h->last_pic_for_ec);
return 0;
}