From patchwork Thu Dec 8 16:55:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 1718 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp976577vsa; Thu, 8 Dec 2016 08:56:42 -0800 (PST) X-Received: by 10.28.126.146 with SMTP id z140mr3332036wmc.84.1481216202640; Thu, 08 Dec 2016 08:56:42 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id cy11si30100334wjd.126.2016.12.08.08.56.41; Thu, 08 Dec 2016 08:56:42 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E6BD868A1D5; Thu, 8 Dec 2016 18:56:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6674D68A13D for ; Thu, 8 Dec 2016 18:56:29 +0200 (EET) Received: by mail-wm0-f65.google.com with SMTP id a20so4736622wme.2 for ; Thu, 08 Dec 2016 08:56:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=MjIcAWrDSo00bAng+ZFd1SadkHDGHCUdwEc74vLuC8g=; b=Hhgts1Wh/r9X9TNH6rfqxHtJaF6wv93JtXmC8ssuUxZOS5sqIaPVoxGSx9AlLzQSEs PPVkRL/32/gHjRq+r4KuyH6HBBi4I737KUL1oBdYVtGHa9WBtGknIRIOWUYi6ocU/XB+ 3oi8qOuCcHzCzUPrzIO+IC4pKwy7YNoIS+YLbNiNr73WofeFLssZBxEEnsUFl4NY+AFk XQf1tk5+gxBa5y4/ztoIuO1UusCZJ0IEF9aYz6ivMSb63TO9KgPgKrONvZ9ayyif9a0x tWpxUt8ekRZYTIjjCABrjIGn9YxuvtFELQscvWsNgQan67Nt0Z/TQu2gTIkrKCEZcS2c ZXqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=MjIcAWrDSo00bAng+ZFd1SadkHDGHCUdwEc74vLuC8g=; b=CQ3i5kznu+7vTjHwWtxNynjX5OJEZ/6ZkodlYnLnB7wEKiAlyXK1owqWdJfliTzNUo t8BWPlE/ERXK16cdLznBqzB6LZhNkAWC5yp0IaM9v5lBT/CcqlBXM+Hv8US4HteHi6vo 6Jhj3aSxQ72PtjJwicgnKuZ0hElTaq66TblYdkOAtiecWTyO6/QY6nH0U4zJy3wI8Lw4 szH6G7ffwudUCGoQpNeWaHhhtaRwWAvYJ0B3VDwQVdTfnqGDTDZsNFBptxIwxL7BSBy7 fXXMw3IJH2kes+JluZzopNttAh9sp+nqcPgwKaJ/F10rdfVAQo7JV0VeM4dpQw2YKtiX 52xg== X-Gm-Message-State: AKaTC01XJGSGyB18SUucRJMJHqEpfz7Tk0kCeS07Wna5NbWElSgchDlM3FyGxzAOelODVg== X-Received: by 10.28.105.194 with SMTP id z63mr3010591wmh.78.1481216192334; Thu, 08 Dec 2016 08:56:32 -0800 (PST) Received: from localhost.localdomain ([62.208.37.185]) by smtp.gmail.com with ESMTPSA id d17sm37936963wjr.14.2016.12.08.08.56.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 08:56:31 -0800 (PST) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Thu, 8 Dec 2016 16:55:49 +0000 Message-Id: <20161208165549.22353-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH v3] h264_slice: Wait for refs to be available before we use them in error concealment X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This could happen when there was a frame number gap and frame threading was used. This fixes #5458. Debugging-by: Ronald S. Bultje Debugging-by: Justin Ruggles Signed-off-by: Derek Buitenhuis --- 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(+) 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,