From patchwork Sun Aug 8 17:29:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 29352 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6c0f:0:0:0:0:0 with SMTP id a15csp2206370ioh; Sun, 8 Aug 2021 10:29:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSOJELa9rFZfrtg0g+dvixfj9MloHUZ6X7R50b5/7w9D36eltlHCJY2u4Gu3KPmt0GhlCl X-Received: by 2002:a17:906:14c8:: with SMTP id y8mr19011294ejc.475.1628443797625; Sun, 08 Aug 2021 10:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628443797; cv=none; d=google.com; s=arc-20160816; b=aHMFlZkuUQxUxBirQ//9funYBOD2LLQa/GvV78MyK/pmcyVtVY7Eem4EA/fOP8fh6X o8dIDpNtgeQkzY7VkxFEsPkdIACEKKlIZWZxvV0VZ9yYqNtxBnHS36IyRTK5vxSth6fb voZMFWYdTT1E8kz4p8u76uA7e+aZpIRgvxy+YjJfiyI0cuG3gA9w40IffSdYMU/EPjJv Qn2yhh3ffd0CS53j3Lq2iIREz1P2Cs/7sOiNF+bwwgsZoBbDBT5iu1zMOi+bEwohTs43 h4TF5QjaWCNY1i29xrsjqcW8NOm3jnhfWb091EbtBWuj8C59N2BVOnt7qlK3UehvyYl4 GAFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=989Lo0p378kQJcrYiU5GGt7wvnJ/qbrfkIwCoR4i614=; b=hwxYvStrElSftOPbFhi7/CpPsBoZPrP0asqTioC7Zh67igabAJ6AwtoV/O2hbby4ho CY6nVHav1acaZkvtLxnNS0HqqjRfQqezhh+2RjEqNSeDDIIEcSxGqVCrtiW6GNmL6xHT Exc7+OvvIe8uMqYp8cH93Vy32J85x8BF/Z1lA0M8IH1EJVKVhujLJIRtfPiV6T8Nr3OK 4VIU+HndAvEt14JRJOXf3B8IYj0cdvlhVsUin69h4WNq2n2U7AbfuOhES1keki2tHwbf koUra0j1a4mZJiAu0IO8aWZ7siz1mJ2sQdPvpgVVUVHaWVAn/UbLEtOZOpZg2OrdsngY Frzw== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 18si9396659ejy.624.2021.08.08.10.29.57; Sun, 08 Aug 2021 10:29:57 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 585F4689953; Sun, 8 Aug 2021 20:29:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 93B6068052C for ; Sun, 8 Aug 2021 20:29:47 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 9CD7824069B for ; Sun, 8 Aug 2021 19:29:46 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id jpxp00MFD8R8 for ; Sun, 8 Aug 2021 19:29:46 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 043622404B2 for ; Sun, 8 Aug 2021 19:29:46 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 2F3663A0185; Sun, 8 Aug 2021 19:29:46 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 8 Aug 2021 19:29:33 +0200 Message-Id: <20210808172941.18238-2-anton@khirnov.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210808172941.18238-1-anton@khirnov.net> References: <20210808172941.18238-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/10] ffmpeg_filter: do not override -filter_threads with -threads X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CkyzLNECP0x6 When both -filter_threads and -threads are specified, the latter takes effect. Since -threads is an encoder option and -filter_threads is a filter option, it makes sense for the -filter_threads to take precedence. --- fftools/ffmpeg_filter.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index b252ee4138..2b1b06268b 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -969,6 +969,11 @@ int configure_filtergraph(FilterGraph *fg) AVDictionaryEntry *e = NULL; fg->graph->nb_threads = filter_nbthreads; + if (!fg->graph->nb_threads) { + e = av_dict_get(ost->encoder_opts, "threads", NULL, 0); + if (e) + av_opt_set(fg->graph, "threads", e->value, 0); + } args[0] = 0; e = NULL; @@ -1001,10 +1006,6 @@ int configure_filtergraph(FilterGraph *fg) } if (strlen(args)) args[strlen(args) - 1] = '\0'; - - e = av_dict_get(ost->encoder_opts, "threads", NULL, 0); - if (e) - av_opt_set(fg->graph, "threads", e->value, 0); } else { fg->graph->nb_threads = filter_complex_nbthreads; }