From patchwork Wed May 22 01:55:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 13236 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 39769446466 for ; Wed, 22 May 2019 04:55:51 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16225680791; Wed, 22 May 2019 04:55:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 85A5D6802B4 for ; Wed, 22 May 2019 04:55:44 +0300 (EEST) Received: by mail-pl1-f193.google.com with SMTP id c5so234677pll.11 for ; Tue, 21 May 2019 18:55:44 -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=d+qoaz1U1UrNXH8mx2K0VKpgIvhjJfIH4p/zWUh0DOo=; b=sY3GBGzTdyouft3KsFp3R4dHETGEwPZlpcMW3nxNS/ymBnjVEBL2YJKm1p8zm/fZV6 IM6Hd/tdG2PmFRbg7Ei8LgtG8lhEZ9FVt8uzCWmbekoOE60rqGsCTmRrPk3ERpQxAOYr 0+Amd1UVZ0c7dtGCyxORlSPAMgR0PR8il+q2NIfEW85/QKMIHl7lcyN6ksDmwqYA5TD6 VrFPss4w4Y4CkIJCmviWRLJuxj+3xlwf9WTBffHgmGfH+WY9wRkSS6O+UyOy3iXPr2WT wR9PiqjX0GliQIWuHlPQAOHBEPaEqOe8TIPI+onOG5IkBcN/ithHSa37or14nhlYJJjh VHtA== 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=d+qoaz1U1UrNXH8mx2K0VKpgIvhjJfIH4p/zWUh0DOo=; b=XezQuFaucU6/RyBSsRt0lOmrfETBEStwvJ3MuXju8QtL+EyWF0ehEPssHHo9oGqtLv XHKzKfgtxQcYuHu3zgr0rFHwHk1VPj0idxuoeijhpysOJYxgR3HaALj1OFk1tWIG8ySN m1rsGxYf9WY30UFchfTkX9OkK/JmldJdS7UJKnHgtp1YRbJOPWIkD+taCEazsmDk4iwR iOSIqmZrN7jks24BNoVmlr7NO8IuSKgThcrP9+qSkAm7hedO5faRaz+mY1KiXxDygZEW RQ5KmyYIg1qiJmOKvVYFiXc0TrYMw6cCvhCfnQ2zsjVCyzjxGRhjj8E4fVVG6fJHaNGR OsFQ== X-Gm-Message-State: APjAAAVSX9lzhNMDv3bsXs85xVcX9bNPVQabGOLWbtKh7aOWgK1CLW5/ EfBU8q0dZvreMlz+qD44Po8uNspf X-Google-Smtp-Source: APXvYqx5BWF2Jb8qhoc4xNdOUgVhDbnbN9vVmBvQb3jkSx278NZRl0YWDvWfk9ZutVHRANCpnOMJMQ== X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr33128502plb.177.1558490142612; Tue, 21 May 2019 18:55:42 -0700 (PDT) Received: from localhost.localdomain ([47.90.47.25]) by smtp.gmail.com with ESMTPSA id n184sm30831814pfn.21.2019.05.21.18.55.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 18:55:42 -0700 (PDT) From: Jun Zhao To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 May 2019 09:55:37 +0800 Message-Id: <1558490138-15867-1-git-send-email-mypopydev@gmail.com> X-Mailer: git-send-email 1.7.1 Subject: [FFmpeg-devel] [PATCH V1 1/2] lavfi/lensfun: Use ff_filter_get_nb_threads() get number of threads 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: Jun Zhao MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Jun Zhao ff_filter_get_nb_threads() respect AVFilterContext.nb_threads and graph->nb_threads both, in most case, we perfer this API than using ctx->graph->nb_threads directly. Signed-off-by: Jun Zhao --- libavfilter/vf_lensfun.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_lensfun.c b/libavfilter/vf_lensfun.c index 3b723dd..089121e 100644 --- a/libavfilter/vf_lensfun.c +++ b/libavfilter/vf_lensfun.c @@ -465,7 +465,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) vignetting_filter_slice, &vignetting_thread_data, NULL, - FFMIN(outlink->h, ctx->graph->nb_threads)); + FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); } if (lensfun->mode & (GEOMETRY_DISTORTION | SUBPIXEL_DISTORTION)) { @@ -493,7 +493,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) distortion_correction_filter_slice, &distortion_correction_thread_data, NULL, - FFMIN(outlink->h, ctx->graph->nb_threads)); + FFMIN(outlink->h, ff_filter_get_nb_threads(ctx))); av_frame_free(&in); return ff_filter_frame(outlink, out);