From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9AEEA48CF2 for ; Fri, 23 Feb 2024 14:32:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6635368C8E3; Fri, 23 Feb 2024 16:31:43 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F27C68C462 for ; Fri, 23 Feb 2024 16:31:35 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=WtkRP9h4; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 85B5E4D41 for ; Fri, 23 Feb 2024 15:31:31 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id RevcTYfGMeer for ; Fri, 23 Feb 2024 15:31:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1708698687; bh=R/LerEsMqvqJIj3p7go4Gg+JhHIm4bn7q6u/xO/wrfA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WtkRP9h43fFYldjQ2KP7zGCI6efIHzgK1IS3/pwF+1ru0vNSc9nVAEkNbvalkw/9k aPUyLUtIM0wOXgtF1AXrOFQreVWskvK5AJ4uEKfTmf1G16y5t7r9lsAGwo4IDyyq4a RUho+q9+RfkSp8t7oCdn520lqWsAyHpS63vm0LPEHP8QwzQiZyD4wUYMVWYA4apBOO BbkfJYbGfNjj/uYdf1uCC6eN+R76iaRs8XgHqdxg8FqXhXx5iNGawggAXsSqnzpYxM D/3WB0bZUj2T+QxM6QbntVq6mWI30JYdzOw9hGq2vOutAon450XaNNLo8/DvtIGI+A qZxvRuPu3yJNg== 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 mail1.khirnov.net (Postfix) with ESMTPS id 784A44D3C for ; Fri, 23 Feb 2024 15:31:27 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 5285C3A1A74 for ; Fri, 23 Feb 2024 15:31:22 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Feb 2024 14:58:33 +0100 Message-ID: <20240223143115.16521-12-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240223143115.16521-1-anton@khirnov.net> References: <20240223143115.16521-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 11/38] lavu/opt: simplify error handling in get_number() 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavutil/opt.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 54a99c689c..75a27c4d9b 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -961,16 +961,11 @@ static int get_number(void *obj, const char *name, double *num, int *den, int64_ void *dst, *target_obj; const AVOption *o = av_opt_find2(obj, name, NULL, 0, search_flags, &target_obj); if (!o || !target_obj) - goto error; + return AVERROR_OPTION_NOT_FOUND; dst = ((uint8_t *)target_obj) + o->offset; return read_number(o, dst, num, den, intnum); - -error: - *den = - *intnum = 0; - return -1; } int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val) -- 2.42.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".