summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Buitenhuis <[email protected]>2016-12-12 14:33:27 +0000
committerAnton Khirnov <[email protected]>2016-12-14 10:38:15 +0100
commit5c7f2cf81df06614f255f061850132355a01d75e (patch)
tree3a701549e7a6c290545aeb97cbd9a8a5109b0261
parent86157e6db2c7a9222f77fa7e7f50fb9aebc3aa81 (diff)
h264_slice: Wait for refs to be available before we use them in error concealment
This could happen when there was a frame number gap and frame threading was used. Debugging-by: Ronald S. Bultje <[email protected]> Debugging-by: Justin Ruggles <[email protected]> Signed-off-by: Derek Buitenhuis <[email protected]> CC:[email protected] Signed-off-by: Anton Khirnov <[email protected]>
-rw-r--r--libavcodec/h264_slice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 8d79740a7f..1b91088f52 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1404,6 +1404,9 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
h->short_ref[0]->f->width == prev->f->width &&
h->short_ref[0]->f->height == prev->f->height &&
h->short_ref[0]->f->format == prev->f->format) {
+ ff_thread_await_progress(&prev->tf, INT_MAX, 0);
+ if (prev->field_picture)
+ ff_thread_await_progress(&prev->tf, INT_MAX, 1);
av_image_copy(h->short_ref[0]->f->data,
h->short_ref[0]->f->linesize,
(const uint8_t **)prev->f->data,