From patchwork Mon Jan 4 00:28:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24783 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:d110:0:0:0:0:0 with SMTP id i16csp5032044ybg; Sun, 3 Jan 2021 16:30:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjIsOOAulro1q0UCrdxtLf+EtxxXZ6RWlBCRJqyjgKhJ/+O0rAGZe8rCXlCglrQ30k0w/h X-Received: by 2002:adf:9e47:: with SMTP id v7mr40891820wre.185.1609720204661; Sun, 03 Jan 2021 16:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609720204; cv=none; d=google.com; s=arc-20160816; b=uAk7NES9Y2j6qwei/l0MWxSyILJoi44M7aPwF7kvj4vME2OgcMw/U+7ryg+vtZvxhB HhJzqL+TPr1bTSE03BkNobgyDWKVvmdJ8a/IZD8YN+nlSit0UC5zrA6TDDIWk3gqQ5Rt P0RMDo2k1nOZ6BeLJAoIl5eEbcPFA7zLTNGrDIvkOYjeN44a5LOELe9L7V1mzg913vkx NZ0B3R6+MdS8HIwClaDqT8vxLPATP/fEzwYLbmuJzl7p/2vwr6hDffocsLRjGX14W0LP bc7x0UKXbQxL3FAS5MUD5pHaPBza9LJAjSlaVKizgxsS/DLZ2s74hy5iVqxMAzaJIDxz iWDw== 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:dkim-signature:delivered-to; bh=JshNkLzPVI8m1GO+q2ONVcMIjVl6l4yv9tgjaKEQvMk=; b=Je2qElOyFs5Rqe+6nsmSHb5GvRoJmaI+/+TAxaifo92GjfKdNQXfjsgWvQSjhn0JGZ ebGKJ8UOxMybDcTt14Nd86vz76DlAoOi3Mowh8vNWZZai1s1qc+b0LHJzvui/4VCR1Wm Kfs71TVrJLqVVWfH9J7WeIiOuM8p6je7YT0jw9RnnO0PjnlGK1Fe5ypvGU16Fd14wlxU n9wx+n7YzJ1roHE4iigkYx3zV5lX2szA4dEP4cV/4slVjf5aT6HQm/g/Jlz/tGK9bhUK IDw3yb54/FvtzcOZIyovUBRlxPICS4fm4z5zOvInPpXg/hVJq+8b4FzHULekih3niOVO oegg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=PV4d0R2H; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i27si53466199wrb.115.2021.01.03.16.30.04; Sun, 03 Jan 2021 16:30:04 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=PV4d0R2H; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A086B68AA83; Mon, 4 Jan 2021 02:29:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8AD5068A957 for ; Mon, 4 Jan 2021 02:28:56 +0200 (EET) Received: by mail-wm1-f45.google.com with SMTP id r4so17534821wmh.5 for ; Sun, 03 Jan 2021 16:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=uh+wmULDNOKRAkFJlo4onBkmaqEiVyqiNnY0qb4pHIM=; b=PV4d0R2H/0KIinS4CRWg5sl8mlGDajr4/V+uVk9K9mzBa6SiKFsAbhhQ1yQYYdiHue 4FjqjVkRmfhkSjfxdMIe75cY1MHpzpF+xLH7eOdeTA7IyFSb9agko6AN+Gs2aUmGsgl6 9qL3GXHEDOe+vezqcQp+MOyiebG1Kyyn/l4ou8Py2QmGafBqqil/YUfVrTpQDHfYbV8K 9k/6d1Bcac2DGo6ib+N3B63dg+sTlgfKQ2yz2kX0vswLn7h/FUa6I7mGkQ+0Rkbr+JYU LiYT62CUhjEs6g0tDCXFivfb8WH1z3bj1FHRn6Tdb9ZlmdpEDQeksjeVQe/gQP3nc4A6 KLjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=uh+wmULDNOKRAkFJlo4onBkmaqEiVyqiNnY0qb4pHIM=; b=Rv/u5l+FThpyK+/B2Zyd5Nk/flI4M3BXBdMqX5YgcQiCwf41mAx1p9dp0YZPuZ2Czu HJ8w+AfNhKjSkYD3dqC0CRGl9rS373JhsXIeJEVJFxZR63PHZUZ9bwhq8+8w3EDcq7Zt m2zIWGBLxeHPtuc/JpHg9WXCjOotvKQLeFU8GjrRi4gFZlUi3WCbkzLNHMIbtI6Yh7th 6NgoFyFjc8woB8tHGOispC2R9/fEShMUux0BDBuw73mSbxS/BGLbcHbqeQB6owPW7i4s IfipOMQU/7bFcuxk9ShcxMQZ4tfWiWsDNS5lz2OTkbKHFnRKn988/7fxi4iWtOxVZSdE AlRw== X-Gm-Message-State: AOAM530+VADTFYCYewX9BN7Kc7ESVRo5jRuo+R98tcTBZa7h4Ote/49J Sisc98ktzA4XaypSf/gMCOo09lZ3XHY= X-Received: by 2002:a1c:dd07:: with SMTP id u7mr24840927wmg.51.1609720135900; Sun, 03 Jan 2021 16:28:55 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id u26sm30032046wmm.24.2021.01.03.16.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jan 2021 16:28:55 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Jan 2021 01:28:09 +0100 Message-Id: <20210104002816.2321974-9-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210104002816.2321974-1-andreas.rheinhardt@gmail.com> References: <20210104002816.2321974-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/16] avformat/hashenc: Deduplicate (stream)hash options X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: 4ou8Vq9I240w Content-Length: 2582 Also saves relocations. Signed-off-by: Andreas Rheinhardt --- libavformat/hashenc.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/libavformat/hashenc.c b/libavformat/hashenc.c index 5523dfd1cd..1e9faf372a 100644 --- a/libavformat/hashenc.c +++ b/libavformat/hashenc.c @@ -42,8 +42,8 @@ struct HashContext { #define FORMAT_VERSION_OPT \ { "format_version", "file format version", OFFSET(format_version), AV_OPT_TYPE_INT, {.i64 = 2}, 1, 2, ENC } -#if CONFIG_HASH_MUXER -static const AVOption hash_options[] = { +#if CONFIG_HASH_MUXER || CONFIG_STREAMHASH_MUXER +static const AVOption hash_streamhash_options[] = { HASH_OPT("sha256"), { NULL }, }; @@ -57,13 +57,6 @@ static const AVOption framehash_options[] = { }; #endif -#if CONFIG_STREAMHASH_MUXER -static const AVOption streamhash_options[] = { - HASH_OPT("sha256"), - { NULL }, -}; -#endif - #if CONFIG_MD5_MUXER static const AVOption md5_options[] = { HASH_OPT("md5"), @@ -174,7 +167,7 @@ static void hash_free(struct AVFormatContext *s) static const AVClass hashenc_class = { .class_name = "hash muxer", .item_name = av_default_item_name, - .option = hash_options, + .option = hash_streamhash_options, .version = LIBAVUTIL_VERSION_INT, }; @@ -222,7 +215,7 @@ AVOutputFormat ff_md5_muxer = { static const AVClass streamhashenc_class = { .class_name = "stream hash muxer", .item_name = av_default_item_name, - .option = streamhash_options, + .option = hash_streamhash_options, .version = LIBAVUTIL_VERSION_INT, };