From patchwork Tue Apr 25 16:52:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Faiz X-Patchwork-Id: 3487 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp2007693vsd; Tue, 25 Apr 2017 09:52:35 -0700 (PDT) X-Received: by 10.28.127.193 with SMTP id a184mr7711914wmd.110.1493139155612; Tue, 25 Apr 2017 09:52:35 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i74si30748374wri.61.2017.04.25.09.52.34; Tue, 25 Apr 2017 09:52:35 -0700 (PDT) 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 sp=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 AECCE689888; Tue, 25 Apr 2017 19:52:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7050F680507 for ; Tue, 25 Apr 2017 19:52:23 +0300 (EEST) Received: by mail-pf0-f196.google.com with SMTP id g23so11481831pfj.1 for ; Tue, 25 Apr 2017 09:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Y/siFExk9wuzAHLERWOn9/FYzd+9B40p3vDJqKHFhzo=; b=I5aaGK95Xuxa5EAEWwk9GvsUShFaWzmSLQSoxErf/0uZYAksyNo5OwtJ0sDCo6ThCo q+RO/uzzdiz27BZleaF6JaUaCQrxA5kV58DfOTgrAVuWRnAaECjn2mik0zvuTt4JopY2 d14PBhKvl7cyG9hpRXLLJ3AoQOEGmK7eV/BZx1uTqrLHXxm03YDx8gck9H0yusFJ0OKw NhdDRDJFB7QlFMMi/lOTSA7oAL2EV32fKky/6946U5+IKzkzA4JScvVBirEvkuQwhy8c atOGjSkDWgNosyX/Xl4IVX+/JK2XhmrD4Dquq4LoBZdn8zTQeHhVfoSjov3BhQPbxJS8 +utg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Y/siFExk9wuzAHLERWOn9/FYzd+9B40p3vDJqKHFhzo=; b=IhNGTeEzWF6TZZNCDdKwRVJ5fCa5jtA/NUaxx9qIJWL3QuVuAjL2n6Lrth4nIlRYLe owyJ+x/9Ozuq/HcL4NI4dPl2u2U0YT3jD37LtPU8E9CZMKPUFrudobzjFvK2N3dfLZtC M2l7Cln4U5ozkn7oIjMb7FQSaetGVEzUViYrNpngO0OQeLhZhDSkFKgtjLeehJp4Cd7k JCwfZfg8R8Uro/yqoURdXHf8TxmWLBPsjS8JmOo5ZobLmUX0m5wZgrrrh7jK1cauVLMD QscYlS55ZcZVJJ1i9ZM8DBrvq3dB1ASAoS7NCXH0yG/GJj17Euml7gcs9ANq9ud1zlzU iN5g== X-Gm-Message-State: AN3rC/43oitv9Fj7qEHyFSrZqa/5h0gnjmLWxWD8KrjIbFk+nFwJoYNC W4bIHNw1Aihtbw== X-Received: by 10.99.24.86 with SMTP id 22mr29233015pgy.238.1493139143011; Tue, 25 Apr 2017 09:52:23 -0700 (PDT) Received: from localhost.localdomain ([114.124.183.29]) by smtp.gmail.com with ESMTPSA id d76sm37527688pfj.68.2017.04.25.09.52.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 09:52:22 -0700 (PDT) From: Muhammad Faiz To: ffmpeg-devel@ffmpeg.org Date: Tue, 25 Apr 2017 23:52:04 +0700 Message-Id: <20170425165204.3061-1-mfcc64@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] pthread_frame: set err from the thread that return frame 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 Cc: Muhammad Faiz MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" when frame is received, not from other threads. Should fix fate failure with THREADS>=4: make fate-h264-attachment-631 THREADS=4 Signed-off-by: Muhammad Faiz --- libavcodec/pthread_frame.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 13d6828..c452ed7 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -547,6 +547,10 @@ int ff_thread_decode_frame(AVCodecContext *avctx, fctx->next_finished = finished; + /* if frame is returned, properly set err from the thread that return frame */ + if (*got_picture_ptr) + err = p->result; + /* return the size of the consumed packet if no error occurred */ if (err >= 0) err = avpkt->size;