From patchwork Mon Oct 18 21:32:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31149 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3750044ioa; Mon, 18 Oct 2021 14:32:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK0XhesngT/SlgHYSCqLFmemVSdDKh3gQviXasWxZsZv8V1Dc9ZktbbTBPkBkBWCPaXAOH X-Received: by 2002:a17:906:f85b:: with SMTP id ks27mr33755801ejb.430.1634592749367; Mon, 18 Oct 2021 14:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592749; cv=none; d=google.com; s=arc-20160816; b=XLUWC4qQZJzzEa1w+FlDWhvIOsq1e0Ep6usoeuPYbOjgk1F42wI0Qmf2rAdOtWHOZB FJQjFMsEYMji31nprIsqPQ6VHtGRrEjQHL71TDb1Apc5gBJ7u8Czq6rsSEp1clHjnEJM /n8ecbGK8IReyJ0dBfkQCO2IKdDy8tf4hejJG1VxLQAUW7QbLvbe6tXtf6ReequjkoSt WxjyRieFlpPDFYBQMSxW1UsgKzX8jr4RYpQ9IyU1+NsV4PFOv1e+6wt2dYohqbR3I30n /V9L+o0/qniVHL+qD9JbE+JQ2epCj5vZaFtMX02dG01Lxhwnwlg1W3uI3dwgUoIr4E2f UHxg== 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:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=Cv8Du5uHcCQiSxg5LefrKMf3iOmsmmgZf+9WgZDW4Jo=; b=oGg1Ao/BRrCCIhboaHp0LxKRXsZHQHCyzhHS+rb9/+ELr8O3wxqD7JNBG6cQuxAdJp fBOjwNuXidEwG+Uqxv6ab/9u5VmTcf7zpc5Jm6+OQwm/7C3YlAS22RVNTK2iT0ExhEUt 6cZwqpbNH3Z2vNVT3b1kBoHN+A+Bl5cFCTlW8UqMHCDGqnsj1MBxy0ZUHUV5K07muQ2C EfBk2XUshyKKs8xFCt1Y2ReXx+Y2ooCUdognoeASEHmsgDgYJ+xsEFHauEoJJeE+DMM3 n4OBv2ZCIokPm6xIpl9nb9iUAuIWQrQ89u8kNpV8UFqWhhIUyC3tgWgK/onVH5HzVg1k UIcQ== 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=p0YHrwDV; 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 k23si20921470edj.602.2021.10.18.14.32.29; Mon, 18 Oct 2021 14:32:29 -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=p0YHrwDV; 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 8078668A701; Tue, 19 Oct 2021 00:32:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42858689A0D for ; Tue, 19 Oct 2021 00:32:19 +0300 (EEST) Received: by mail-pj1-f42.google.com with SMTP id gn3so7599351pjb.0 for ; Mon, 18 Oct 2021 14:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=Cbk1/wS/xe12sVhAMa2k/eoO5hAQTMXGipVgArXqvCQ=; b=p0YHrwDVhNOf05f7S63H0QG98I3ks2kmISrARoGa476svnXmMJDDLAyc+IrXR4+Zok wFuJeniqYI12+zvxmCFXKk9SRAN8bD4Jl+se6LZTV7i1rWL2lINV34LxZnfr1wlHkPLO 6sRM3szmaWICaMDfAC01B4tIFUPUt0WK5dqorptg3/JwWkbF2lNWDTXbzEjjVAnU4bJ9 vwW6EE+qmAiKxBWcvYFlR4GjTkAGe8mhrXV+uP7nWg2xs0Gg6iwfCbzc4uKLht73BRfM Hul0XVL2HvXg5ypdTI3RIxnGaWiwzxcWJbK1sEUOCZEaYygHNQMvMkAo+6B4h5+4kwOL 7o/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=Cbk1/wS/xe12sVhAMa2k/eoO5hAQTMXGipVgArXqvCQ=; b=pCAD4NBWuHByLhGGqKdK2H8URW12y3ZJ8h6/EqEsRPuQUYbauRQjNipMh0Mmqc4TjM TZuII17mgQi2QJ6CmuqYDHj8W6c8wdKPp9ntxW66umTyxLSoR0Z379UhzIJvmV0c2jlC w5KSME7xfZi8zDH8eyxI0nymuUYfecLJ7qGTdjBfnrgMMhIhEYOVe5rz0YTRlZ3Hcirh e+zmaEKKBG9+UjwEPMGnJC+ersg8STbpTZCBqZdEj6SS5NjD02J/XI1lkg/s+k3XNVXV wMxrOiSG8fhckLTGdsTD20+5h6/LXeG8B0A9PRm1kagXYOLHUnebHrcbH/w+9wQKIK72 yhUQ== X-Gm-Message-State: AOAM530E4mSP/mbXZNEhL+pRNI8mHn9jvu5ETumR+GM3ZNNjDq3g0u4R 9mvZfwAmLNRH/Wy9Jmdxt+YKH6wDPXM5Yen6n5o= X-Received: by 2002:a17:90b:4b4f:: with SMTP id mi15mr1606497pjb.97.1634592737346; Mon, 18 Oct 2021 14:32:17 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id y3sm13720647pfo.188.2021.10.18.14.32.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:32:16 -0700 (PDT) Message-ID: <0ec537d7-7126-d794-9f6d-c6cc333718d3@triularity.org> Date: Mon, 18 Oct 2021 14:32:16 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org 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: 1MuWRgGuv4xb 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;