From patchwork Thu Sep 2 15:41:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 29961 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2a4a:0:0:0:0 with SMTP id k10csp401071iov; Thu, 2 Sep 2021 08:43:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPGsvtrq7sIxGI1mHQfMWjS41lG3zHrD1fRD0T6ni27sujywj3JaMK20fHZNnaWJrea2XZ X-Received: by 2002:a17:906:a3c3:: with SMTP id ca3mr4429486ejb.337.1630597406038; Thu, 02 Sep 2021 08:43:26 -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 m27si2041849eje.688.2021.09.02.08.43.25; Thu, 02 Sep 2021 08:43:25 -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=@outlook.com header.s=selector1 header.b=MOy6+M0O; arc=fail (body hash mismatch); 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=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E553868A630; Thu, 2 Sep 2021 18:42:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-oln040092064055.outbound.protection.outlook.com [40.92.64.55]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4AF1A68A60C for ; Thu, 2 Sep 2021 18:42:02 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PyipRYs4WWE8oPKfk/l6WHpnMMWZCjzGHbDKkqZM7NEjJ8kY758ztRLaJtaDVdlicgowyDNKw944LK+5jSvA5RJxtbx28M6z3m5vKNXaZOG0vrsMoRDxYvjiq6x3LF5GkwgBM97SLqLRHBtWJItG2CSNikC6BuNpLmS+RZCSRDZc59NUNatopRrGZyemwpxFgDCBkVCiQESfsHerkZgVoIa1DV9RM+1ZrHjyIjGD1emmplekDx72O0DLwQQC07z6EDmjbYaA7DY2MXvmGyi3g9dsven6Laof1vLmp1/FH9+BXDtods3vNNEE92IS6CFkE9wEKxjVPteGENmPYGRqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hs8V02W1Vi9kMCxJT6xlxnkmgAP3IgBfIKa3WNH11g8=; b=bBYW3nJ0SuGHw5rCIZKsu14lWnCF6dz1cIDSQ1ye7x6ZD7J82I7vpYhIhXgkyrq0+MCHAigJgPdViX+obXQcku77J/FLDtbIoga+E7qxTuUkEUD5kCV4hwgvrv5flyvuhrryDh37sxLgukYO+DExqMIGjX7DhdqffN/dEbxDELpfmVc99Kjimh+Qk18UGIFpFSgIzSB4OESSS5wfb4ai3HU+FSNAAlYLInf+QNWZJB91+3ayxa9p90kUGyOHgNBVkR2eYEXaCH6P8+q8bTnGnmWW1cRltutrxo8DFdv5Dt61GUulpjsAu5zrWy9yb91W89ZiQ3UUH9QTJdFSxEdDnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Hs8V02W1Vi9kMCxJT6xlxnkmgAP3IgBfIKa3WNH11g8=; b=MOy6+M0O2SVFhuTD4Go8QhcNCRucC3VgWxmiEUCReCwBrwFr4zDU/ONWT6CPKP4u+UKEqA3KbmqyBr7eQngDAR3axZpdDKEDAXPTkMts5GEx+QiV04FTvozubHeeG/fuZrIurxggh3IwgknTw0RJfjcIrz31wjdnlbzQaJg0W+QOqzcGBykVFPcnRrN72fdQQz/+BrlUK/gOM936ux2Z+P5DX9Grwo9uUZimQFA6S+memVsXMtTiucxXqPExvrbAimtOdQsegt6ADqmzXjLaH5tg3epW7/9PO3XlYo1jdq1NQXF3qxC60i/mDz1lKftzD4ZyreNTmJHrkOmmlvdJwQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM7PR03MB6532.eurprd03.prod.outlook.com (2603:10a6:20b:1c3::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17; Thu, 2 Sep 2021 15:41:49 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f8b5:1ef2:89b2:f8c5%7]) with mapi id 15.20.4457.024; Thu, 2 Sep 2021 15:41:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 2 Sep 2021 17:41:22 +0200 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [GCCAmvak8a9wyEiQsh15+RgRWveUaeyb] X-ClientProxiedBy: PR1P264CA0031.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:19f::18) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20210902154127.2571616-7-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.142.38) by PR1P264CA0031.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:19f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.20 via Frontend Transport; Thu, 2 Sep 2021 15:41:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c4ef1bd-e922-4b84-f8ef-08d96e282dc5 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRAro5Pl0DReHj5zSq9SRg2IKML9ZuGSN19IfQvm0K5F0UaXItQmRHLqEneaNL6vYjIR0heTn/7MVqo51Xn48QzK6cbLfPD0IvynQBg1y+VXBt3XnUX5pWcM0IYGhbvS2zYWXr0p4t3kJ65INIfSpJbHYTPva9x2YBOzq09Tr/2ERc3bpl68+153foJqJDFxzRHVTqmOMwBT4cNd5O5UvhAyd+x2eA15iC8gY/O42nCQwH8uOfVWoUyzg1s11VyI3/0yDluCzBg6WxR560pfkObQmo+JUMtRRpMgJyC/xYe8er0o7w0LHQLTy/Um/SBFiByOAjIdHO16foFIPRMvfgZYm32qrhjcUnJ4Je123pxFFfUh9TzO80OsU2eyJcU8d4sGoCAzJwQNpsJJw7nwQCqqzICd+gPXnF36unz6elTJYR0ZXGyqqDuGOel7LnVVoMWNO2/frsTofMPjF/kcG78HOpUR9ae9AW8sVDXE0ZHI5Yod9/uPGE4PmElWWM1mP01QPMdwGIjqCbGUBHL7nTJssb9WM+ZVjFsaws1bBJ5d/9j8+pVYH1fGyDbGbB/kOY4Fq7AB8JnE/4eRbt+ouIFWcqHrmItrlAuw59S/9P17asL8sAfKbkD3xzzZ2qJfLAZNgSqLfCMUqzJg337FHgv/M4EDzr301+D4/cJ+9FviULf4z1uy4WbM2WLMNFtM6/RKQYyA//oRmRp4SkpJd/jKCKCkgS8QEM3YP+7ktKGZNzO8qr+wxZ6PVdOAdrrmP4= X-MS-TrafficTypeDiagnostic: AM7PR03MB6532: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2MSPyPhcHUpD/eEATP9EdhDekciMSMlwk9lP4emOCa/IGe1g8YPuFRR8bJbLLG1/aajQnX+9O01tj4Wh8KVvArq+Bn3rmOVW2m1z5e/xo9qmXycrrvQrS2TLlVpHWAcT9aEmLSnWDMVIeUXpWZbGxq7Zmb36KR0FeHYvuhn1M3q4WX/fGA+YxleP3MKXWB8EYrqg4iIih40JxuWtgUtmzDtCtIFER4uOVlvE0lWSN71JFJwFHUcdsJ0cR6BKA5kU4/W9lNkv0wG3Tr+4pwNv3xpvsKUoTccNDY0qqFNNfzbUTLoJZLOrgqHNHSJKN0PIiBcp8iCl/AmfxZa4EAOcgVxchsBiUUY7RKOHS4QekzVNyVOytRt1sdoMpHTHOsyDqXyx2fPNMigh6HyCyI1aRf001vIPlyZ2Ylo5c2JH6gJQ+qvBZG78pZowV+NtNgTY X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q3mhyzC50U/k9JuN4D9nrRJ+1xuK1FFBT6mZCFYLVii7BQOmq4D2d09DY3C0ZY/8LsXej+fLPkXTDIoG+0qi1w/+UZ5iWlcoXh0iL0Hk7vR41orgRQDCITTZ18dLQzP5Zk9Gz44DPf6JNZ0b12VG7g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c4ef1bd-e922-4b84-f8ef-08d96e282dc5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2021 15:41:49.7612 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6532 Subject: [FFmpeg-devel] [PATCH 08/13] avcodec/frame_thread_encoder: Reindent after the previous commit 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: PxLa3JpZcH04 Signed-off-by: Andreas Rheinhardt --- libavcodec/frame_thread_encoder.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index e5f6544750..8f8294374f 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -250,21 +250,19 @@ fail: } void ff_frame_thread_encoder_free(AVCodecContext *avctx){ - int i; ThreadContext *c= avctx->internal->frame_thread_encoder; /* In case initializing the mutexes/condition variables failed, * they must not be used. In this case the thread_count is zero * as no thread has been initialized yet. */ if (avctx->thread_count > 0) { - pthread_mutex_lock(&c->task_fifo_mutex); - atomic_store(&c->exit, 1); - pthread_cond_broadcast(&c->task_fifo_cond); - pthread_mutex_unlock(&c->task_fifo_mutex); + pthread_mutex_lock(&c->task_fifo_mutex); + atomic_store(&c->exit, 1); + pthread_cond_broadcast(&c->task_fifo_cond); + pthread_mutex_unlock(&c->task_fifo_mutex); - for (i=0; ithread_count; i++) { - pthread_join(c->worker[i], NULL); - } + for (int i = 0; i < avctx->thread_count; i++) + pthread_join(c->worker[i], NULL); } for (unsigned i = 0; i < c->max_tasks; i++) {