diff mbox

[FFmpeg-devel,v3] h264_slice: Wait for refs to be available before we use them in error concealment

Message ID 20161208165549.22353-1-derek.buitenhuis@gmail.com
State Accepted
Commit 5c7f2cf81df06614f255f061850132355a01d75e
Headers show

Commit Message

Derek Buitenhuis Dec. 8, 2016, 4:55 p.m. UTC
This could happen when there was a frame number gap and frame threading was used.

This fixes #5458.

Debugging-by: Ronald S. Bultje <rsbultje@gmail.com>
Debugging-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
Extra help from Ronald enlightened me to the fact that there
is actually this field.

Patch 1/2 in the previous (v2) set is no longer needed.
---
 libavcodec/h264_slice.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Dec. 9, 2016, 2:29 p.m. UTC | #1
On Thu, Dec 08, 2016 at 04:55:49PM +0000, Derek Buitenhuis wrote:
> This could happen when there was a frame number gap and frame threading was used.
> 
> This fixes #5458.
> 
> Debugging-by: Ronald S. Bultje <rsbultje@gmail.com>
> Debugging-by: Justin Ruggles <justin.ruggles@gmail.com>
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
> ---
> Extra help from Ronald enlightened me to the fact that there
> is actually this field.
> 
> Patch 1/2 in the previous (v2) set is no longer needed.
> ---
>  libavcodec/h264_slice.c | 3 +++
>  1 file changed, 3 insertions(+)

this looks reasonable

thx

[...]
Derek Buitenhuis Dec. 9, 2016, 3:07 p.m. UTC | #2
On 12/9/2016 2:29 PM, Michael Niedermayer wrote:
> this looks reasonable

Pushed.

- Derek
diff mbox

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 1f2c06521e..9a334a97cb 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1424,6 +1424,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,