From patchwork Sat Jul 15 10:46:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 42712 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6da1:b0:131:a7d0:bc6d with SMTP id gl33csp4240744pzb; Sat, 15 Jul 2023 03:51:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQPbcEBf9SqxdIKicJMskfIpYSKaQ7DxkX24WDCmQdCj0GfkpjsOq3uB1xiWsiAq6iBRAQ X-Received: by 2002:a05:6402:149a:b0:51a:5ebe:4ab9 with SMTP id e26-20020a056402149a00b0051a5ebe4ab9mr6065003edv.14.1689418297152; Sat, 15 Jul 2023 03:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689418297; cv=none; d=google.com; s=arc-20160816; b=BaZNMBpCSKq7ZOU/hqXCxQIC25SNhy68pF5I/IL1GqnDin+tbPMo+sKtAM85xPR7HJ 4Bg4BPN9nh3Ussn3Udy3sVhEei3gsgDCgkf0dUDyX/zW3y8A8Vifu1deV2TsLzCQoRET D+/BL40uZbSMciKzX3O/RvBks13wEZVSQG6FkJ5QUnwA4JNRtY05xY0gJ5+Ft6yrK8Jt ulnEt1VorJwgZzFsRAqNlTLhMtxPwSSMNTJvfLhnmoA9ozHWRXUS/LbFKR3czUBeH35z P0E/fsz31Nk16OVaPfh2QzdxgHX0XDA1KBjT1OikxZW5E17UGkxbjZU7KdlP2SpAHESB AZPw== 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=2keHEIl7wGcoXRmu0P9I58ai+pzYhoEHHR1HTtOvzGk=; fh=8ZF2QtiKOjBtyn9wuO2cMeZaLsE4aq02Bq77gGK61E8=; b=CZw+vzJxSO/BGV7putO9bTQDmT+n1oLg1BY9iTHSstyH/+lIPfDwuxtSh3e7UeqeEW eY36A+HaEu/DBTKLGwcr1W0M3CIP/E3QEBDqP1AFK43MXOqYPql+n3XJBZLpYa6pmWDO 31g3KfXigNFW6Fi3O7OnuJFfExckzN/pxZvVof4JFR3toeezgn6uF2gjhk4oJBkVHuyO Qq+LPDiEBNoM18+A/JrOJZBCfXVW2EZOpJpaZ6ZdH3WAayO5WnVEn6GPiPicqK/nxp7l kabYJFIsKt8U92L8tZmvsJgSHEar08cukLAz9s408wE3lTueiLrChf/QwkQhZA3PV0dW NU4w== 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 be1-20020a0564021a2100b005203311fd98si3343579edb.131.2023.07.15.03.51.36; Sat, 15 Jul 2023 03:51:37 -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 ACF2768C786; Sat, 15 Jul 2023 13:47:13 +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 5E33468C6FD for ; Sat, 15 Jul 2023 13:46:49 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 1323F2404EE for ; Sat, 15 Jul 2023 12:46:49 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id biPTzPCnl5yL for ; Sat, 15 Jul 2023 12:46:48 +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 3A2DB240D2E for ; Sat, 15 Jul 2023 12:46:27 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 2A31E3A2874 for ; Sat, 15 Jul 2023 12:46:22 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 15 Jul 2023 12:46:11 +0200 Message-Id: <20230715104611.17902-47-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230715104611.17902-1-anton@khirnov.net> References: <20230715104611.17902-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 47/47] fftools/ffmpeg: stop calling exit_program() 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: itmSzRxJcxJx Remove exit_program() and register_exit(), as they are no longer used. --- fftools/cmdutils.c | 15 --------------- fftools/cmdutils.h | 10 ---------- fftools/ffmpeg.c | 4 +--- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index bceb778ff0..8a3b4bd285 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -83,21 +83,6 @@ void init_dynload(void) #endif } -static void (*program_exit)(int ret); - -void register_exit(void (*cb)(int ret)) -{ - program_exit = cb; -} - -void exit_program(int ret) -{ - if (program_exit) - program_exit(ret); - - exit(ret); -} - int parse_number(const char *context, const char *numstr, int type, double min, double max, double *dst) { diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h index cc2180f768..4779b280fd 100644 --- a/fftools/cmdutils.h +++ b/fftools/cmdutils.h @@ -49,16 +49,6 @@ extern AVDictionary *swr_opts; extern AVDictionary *format_opts, *codec_opts; extern int hide_banner; -/** - * Register a program-specific cleanup routine. - */ -void register_exit(void (*cb)(int ret)); - -/** - * Wraps exit with a program-specific cleanup routine. - */ -void exit_program(int ret) av_noreturn; - /** * Initialize dynamic library loading */ diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index ecb3f89f85..6130fd06fc 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1324,8 +1324,6 @@ int main(int argc, char **argv) init_dynload(); - register_exit(ffmpeg_cleanup); - setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */ av_log_set_flags(AV_LOG_SKIP_REPEATED); @@ -1376,6 +1374,6 @@ finish: if (ret == AVERROR_EXIT) ret = 0; - exit_program(ret); + ffmpeg_cleanup(ret); return ret; }