From patchwork Sat May 18 16:11:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 48987 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp3522968pzb; Sat, 18 May 2024 09:12:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUbDawpc7BDe2pPDMbQy8tkGxoO9L+v3eTmra3eUStfunB8H8Vq4QVtEz+m5iuMc/zOI2KddwiWiqb3r/6/WRBF3a58tGThHJz5fQ== X-Google-Smtp-Source: AGHT+IH4kABcFYxF7bloMw75U3qUp+icZlY3LcKkkRlUSxFbdpa15aD85vfeuz0sRNGWRcrWNts2 X-Received: by 2002:a50:9b06:0:b0:572:727f:d0db with SMTP id 4fb4d7f45d1cf-5734d5c13dfmr16595735a12.15.1716048726208; Sat, 18 May 2024 09:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716048726; cv=none; d=google.com; s=arc-20160816; b=wRnM9smchEzlyCmNDWag21lM4mGNgTGHpflxbR3VociV1kTjeXY6oifMF/jYIcIOm+ N0Hv/7tLL6wqpH1Ug2gam+poFdRHwzkHiQjssd/InkOn7+WZNvAwvohkCzrlADtSDGgL fWYL/tiZR83XE3x0Vyp0eflntnQ2ODOhkrUBL6PpWS5Xh7zlZVBIQniInW5O4k5Srftj maO+Qh+Q3G5t+vBySzELa8po00KcFWXMVltTWpscaZuyQ2eRBHaz5kJu5Est3G8DRqY1 8Fdl+Ma4bvPeNeVYoFoXu106uVceoSDw46kgbRdbN0eszXdTX5HdwsU2NteHm6MDFJD2 eOww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=U5Qht0mxwIgLTdhjgfUn76oFlQfGAjPFmiNcBtDfidc=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=qqwjt/LSDzNsUOpVUleZTkelDGIN5QVqOfHA/IatTLVI8rwcqKjzrALyhUPNsapaxB bsPxZ29PXf9pTxrdxUFtgpt66Q2qvZ4BuIhhJ2KHi5bcRdre/3KJ9Q4aScwMvsgXqnJQ tbCQu636J1vWTaC9kDu0viDpzQW/XU+ezD8oZ7HDcL9ABGVItSKpAmJk7gXE4B0/goGs iBo2gFSBEXzy8iRoBocVonMblAbiNmkSeZNSHjX0jr77KRfHPqAr4K2WbH6/1MvGDhg2 ULbb56wLC9ZZkthihCkExyUG5vNRE1vrL5rNY/TyAbMkvH6HMiYxwtlcEOY+bBOt3HB6 38Zg==; dara=google.com 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 4fb4d7f45d1cf-574e13c0966si5866724a12.338.2024.05.18.09.12.05; Sat, 18 May 2024 09:12:06 -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 ADDC268CFCE; Sat, 18 May 2024 19:11:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A86F168CED8 for ; Sat, 18 May 2024 19:11:31 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6E0C0EA681; Sat, 18 May 2024 18:11:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G1Kc2DycIqxZ; Sat, 18 May 2024 18:11:29 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 61BD3EA67D; Sat, 18 May 2024 18:11:28 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 May 2024 18:11:15 +0200 Message-Id: <20240518161116.8661-4-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240518161116.8661-1-cus@passwd.hu> References: <20240518161116.8661-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] fftools/ffplay: use cmdutils code for checking remaining avoptions 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Apl3zLVeVmiM Signed-off-by: Marton Balint --- fftools/ffplay.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index b9d11eecee..ff48fa5f8c 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -2626,7 +2626,6 @@ static int stream_component_open(VideoState *is, int stream_index) const AVCodec *codec; const char *forced_codec_name = NULL; AVDictionary *opts = NULL; - const AVDictionaryEntry *t = NULL; int sample_rate; AVChannelLayout ch_layout = { 0 }; int ret = 0; @@ -2694,11 +2693,9 @@ static int stream_component_open(VideoState *is, int stream_index) if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) { goto fail; } - if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { - av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); - ret = AVERROR_OPTION_NOT_FOUND; + ret = check_avoptions(opts); + if (ret < 0) goto fail; - } is->eof = 0; ic->streams[stream_index]->discard = AVDISCARD_DEFAULT; @@ -2862,11 +2859,9 @@ static int read_thread(void *arg) if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); - if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { - av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); - ret = AVERROR_OPTION_NOT_FOUND; + ret = check_avoptions(format_opts); + if (ret < 0) goto fail; - } is->ic = ic; if (genpts)