From patchwork Sun Apr 9 14:08:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 41046 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp1592421pzb; Sun, 9 Apr 2023 07:12:48 -0700 (PDT) X-Google-Smtp-Source: AKy350ZsrhzGHpdWsopc2T2U5yD2ffjOHfMfZS2KG+Kt0WbTANMhT6tzkkVRtpXxdXeBHC8y2hLb X-Received: by 2002:a05:6402:1501:b0:504:784e:47d9 with SMTP id f1-20020a056402150100b00504784e47d9mr7494438edw.6.1681049568518; Sun, 09 Apr 2023 07:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681049568; cv=none; d=google.com; s=arc-20160816; b=li6F4iHGOH2QGJESZpvlJ6YXSfCvMj3va5yor5BTslH7XwV6k5AcRAhsp4oI5O2KW6 M9zB5Khso2DR451FKjv3xhGv81tQ2ud/ftKBA+UB1RgQf3UhSa5ckVVHoZu6ISvJyVZj N+o0sUrkxsSbuuLANs6fxWimS4U96+RSJGlE2Z/896neiZesNwcOmFeCah3QDiSlwfpS vmmesiNtstP0Cc2fEwdwztH5ONAbMtx0BNyY9hDQMggudMzMCEkbCI/mS09hf05OB7lp XFjPp3YBmnlV2iFkBEJjhoFdB1K1jLI2gHxZUD7JVJNqzKtfnQvDtbRL76F+C9hRTpWz EN6w== 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=LXN77rhYSZkwGPJ1xQOSUl+7EsSkcj77k5c3Iwv8zEI=; b=00oKNWP0cE4f3BwDazpB8Ug/GXcPWrihbUzbaOGDOzxShpWK8hHHremPN7uejts561 qMXfGYSeYS3UL/Qrew8FVc9tx6PU6l2oz1egl/SDqY/43zrGbZ69UltuOGmgkM3w5ziZ PFGXnj/tCMHqu8h4/6kS5xzt4CuvLon9iDtz7HXaCya/OBx/QmujLyXAFKAmqtPx24V7 2GtdO1o7OzgE52Fj5w7fNS20En7Ox2BbfhWxtDdAs83Tk1In89Psn8QVxoDgdNPHbY1k V/NvINlxFOFLIo8jpESgAanFUKwkWm+6kgU9RefgCdBr3LX9dV/posUpx7yad5pUk7Yq lUYA== 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 a24-20020aa7cf18000000b00504a189b831si638132edy.104.2023.04.09.07.12.48; Sun, 09 Apr 2023 07:12:48 -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 1D1AC68BE85; Sun, 9 Apr 2023 17:09:41 +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 CDE8D68BD67 for ; Sun, 9 Apr 2023 17:09:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id C84972406CA for ; Sun, 9 Apr 2023 16:09:13 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id qglg7zJnFIHw for ; Sun, 9 Apr 2023 16:09:13 +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 4CC022406CC for ; Sun, 9 Apr 2023 16:09:10 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1476C3A05C8 for ; Sun, 9 Apr 2023 16:09:10 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 Apr 2023 16:08:32 +0200 Message-Id: <20230409140853.28858-8-anton@khirnov.net> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230409140853.28858-1-anton@khirnov.net> References: <20230409140853.28858-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/29] fftools/ffmpeg: move the hw_device_free_all() call to ffmpeg_cleanup() 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: bH6u3ousa6eh Frees devices on failure as well as success. --- fftools/ffmpeg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 1cd9a8f29f..816b6c4b08 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -551,6 +551,8 @@ static void ffmpeg_cleanup(int ret) av_freep(&vstats_filename); of_enc_stats_close(); + hw_device_free_all(); + av_freep(&filter_nbthreads); av_freep(&input_files); @@ -2973,8 +2975,6 @@ static int transcode(void) exit_program(1); } - hw_device_free_all(); - return 0; }