From patchwork Fri Oct 1 21:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30862 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083248iob; Fri, 1 Oct 2021 14:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYTPc+kj1fr+ihmkWvMhjiG1HPT/ulOcN1f0e7T62oK8u34mzf18V2GAWvLpFWU2yQzX4i X-Received: by 2002:a50:da85:: with SMTP id q5mr266745edj.300.1633122189932; Fri, 01 Oct 2021 14:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122189; cv=none; d=google.com; s=arc-20160816; b=CVZpfTyKArdE7KHiICNVccBHWKP+x3pr2sTGCvo3z3yR3jVUAw0s6L4e6IHWJSoTZU LQ7AAw51+MJKnvrDBZx6p4YmbYlF8K5pxOdd01j24EFetLXqlmC/Gj7/PzCyfrJdu3Rd D6ih2gWxbNtKZBf4Nfam2w94U9rMF5ebQ6jX3viGqaNcMTLXfHblU74iqs0MuGAHE96t kbC4TAZD4auHERc0PAXwnznUAztUEnR8yRKB+guWg1QPZ8vWFKHKU9/2si4MI/e+dG5C RBhqkX6UhnheRpmQgul18zWayNxLqlPwqIDim1sZZL89OsW9T2qwyWoiX6rbkdrOVh3Q mlpw== 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:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=YB6sX+5N+P1BQK11jBqUcvhuBZRb/fmE0Q5cv5W+1NQ=; b=FCTDhpfJBXAm59ZwlHsyoKUk1yKDcR34e3E58WCrUZRAPk5g5jYgJCtwKCY/98ug4U XW/zai9e6NFQPvaVqyOOatp8FSNu1EsIRTdLGvXP/graYQmhTYPJJT7f9XkeaoN1qwLz pBEDxdFjqGBFg+EQv7g5OsGCAG0w47z4EfO78TpwGx4GxL5ccvQ5ckpProiw87hk3Lze 1X/PLuEqQ2JcV6k/UvM4ZNF9Wa5WBLIs7i6+a1tftHRX15tYWRyR5jiANsjuHs3IWp78 +jkLBL0BivYnFerhPAQMzj7iP4nScD/HuIeCi8t/2zjSlJV+2hJRUMeKWG/GbQwAIkzV ViKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=w+X1h5l+; 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 g26si8381347edr.225.2021.10.01.14.03.09; Fri, 01 Oct 2021 14:03:09 -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; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=w+X1h5l+; 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 57F6C68A825; Sat, 2 Oct 2021 00:02:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43C4868A7A1 for ; Sat, 2 Oct 2021 00:02:50 +0300 (EEST) Received: by mail-pg1-f169.google.com with SMTP id a73so7572972pge.0 for ; Fri, 01 Oct 2021 14:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=zHuRv/oBXkzoLkaeccCCCMXR2ECMfEDnljT+fo113No=; b=w+X1h5l+VWo5nntZqDmKmzFYbk9rSiWLUHu6YAw6sbbH0HUP+TA+aGsjjup7uizKbe 2WvOj2N7M9dZ8dFDjLDVV8Tyu3peRam1u4dMNdFqza2jIrWKFehBP5erGsCd/J4Z01lt q5EDczeWu839twX5CBvbQ1bLckKsjg54c7OoQiitP+yIntK5uYsqowytggzKPJn4noik HennzBIsTuPysuscZkvuoKt2WggcesKlkpXKJyMyRS+ViVQhBIe9fQAbMQyK4LxISIYb JLkiAXlSHgFN853vdMbzk5pOOlrjE/ukL0ptZxKnrxasCxUl9idd6+uaUd6mbKnNZ5Nc 8yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=zHuRv/oBXkzoLkaeccCCCMXR2ECMfEDnljT+fo113No=; b=aC2gtMPQl1OrhsdQwfNzLgdB130YgQap8Qj/7QDpf6Wf15yV+b9E8DoQO38nmiICIa DtJ713fhrsxdfOt+vbX0jxkc8NXbVYDzK/N8/BzM43eMXfjQvq+JX1BYD+dFnrQLkjVV XHJJfdFQhVLc3ndFPnumw32LdaKqMpqT+aC1NYK+MUym+UwfI+FnDf7VXNqJ5A1XcBsx JvI1uOO/U25gY0DDEbhZOX5PVf/lSeUrRSLgfjtRS002FPjXwdBOXfO0fVcPx+ZDI1g9 pUihg5RIHBEAIZO3XETGDX5CWZ4iorM/37Gf9Dgn+nY1JUIm7f/uYjLiPigatJaEx+cS ucRA== X-Gm-Message-State: AOAM533pWSUkHkoJjNgy4eN/bf/H8ysYmFqqgqX2TLD1W0kupxEkqw7R TyF6lMwQ8XJbXJOtNQOKOAdjp6fhNCuKWxRxjSM= X-Received: by 2002:a63:4b4c:: with SMTP id k12mr148669pgl.172.1633122168165; Fri, 01 Oct 2021 14:02:48 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id w5sm6755261pgp.79.2021.10.01.14.02.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:02:47 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <816fdcbe-439f-9524-6c88-2df255b1a262@triularity.org> Date: Fri, 1 Oct 2021 14:02:46 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 4/6] libavfilter/: constify values from av_dict_get(). 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: Vb8FZxPp+ygz Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavfilter/avfilter.c | 2 +- libavfilter/f_bench.c | 2 +- libavfilter/f_drawgraph.c | 2 +- libavfilter/f_metadata.c | 2 +- libavfilter/f_select.c | 4 ++-- libavfilter/vf_cover_rect.c | 2 +- libavfilter/vf_drawtext.c | 2 +- libavfilter/vf_scale.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index f325918021..c0573d53c9 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -939,7 +939,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) int avfilter_init_str(AVFilterContext *filter, const char *args) { AVDictionary *options = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; int ret = 0; if (args && *args) { diff --git a/libavfilter/f_bench.c b/libavfilter/f_bench.c index f7098adaf4..16ca17723b 100644 --- a/libavfilter/f_bench.c +++ b/libavfilter/f_bench.c @@ -69,7 +69,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->action == ACTION_START) { av_dict_set_int(&in->metadata, START_TIME_KEY, t, 0); } else if (s->action == ACTION_STOP) { - AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); + const AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); if (e) { const int64_t start = strtoll(e->value, NULL, 0); const int64_t diff = t - start; diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index 9996eb3b0e..7cc1efb3d7 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -163,7 +163,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) DrawGraphContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVDictionary *metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; int64_t in_pts, out_pts; diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c index cecfe62a9c..ee87a2b37f 100644 --- a/libavfilter/f_metadata.c +++ b/libavfilter/f_metadata.c @@ -306,7 +306,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterLink *outlink = ctx->outputs[0]; MetadataContext *s = ctx->priv; AVDictionary **metadata = &frame->metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL, !s->key ? AV_DICT_IGNORE_SUFFIX: 0); diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 187e98a1a7..ab26676e57 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -304,8 +304,8 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) static double get_concatdec_select(AVFrame *frame, int64_t pts) { AVDictionary *metadata = frame->metadata; - AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); - AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); + const AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); + const AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); if (start_time_entry) { int64_t start_time = strtoll(start_time_entry->value, NULL, 10); if (pts >= start_time) { diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c index 0a8c10e06d..d3a9755234 100644 --- a/libavfilter/vf_cover_rect.c +++ b/libavfilter/vf_cover_rect.c @@ -135,7 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; CoverContext *cover = ctx->priv; - AVDictionaryEntry *ex, *ey, *ew, *eh; + const AVDictionaryEntry *ex, *ey, *ew, *eh; int x = -1, y = -1, w = -1, h = -1; char *xendptr = NULL, *yendptr = NULL, *wendptr = NULL, *hendptr = NULL; diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index b1ea58f30a..197163f426 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1032,7 +1032,7 @@ static int func_metadata(AVFilterContext *ctx, AVBPrint *bp, char *fct, unsigned argc, char **argv, int tag) { DrawTextContext *s = ctx->priv; - AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); + const AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); if (e && e->value) av_bprintf(bp, "%s", e->value); diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index a1902a13cf..698fbc4768 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -551,7 +551,7 @@ static int config_props(AVFilterLink *outlink) scale->out_range == AVCOL_RANGE_JPEG, 0); if (scale->opts) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; while ((e = av_dict_get(scale->opts, "", e, AV_DICT_IGNORE_SUFFIX))) { if ((ret = av_opt_set(s, e->key, e->value, 0)) < 0) return ret;