From patchwork Mon Oct 18 22:27:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31152 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3791754ioa; Mon, 18 Oct 2021 15:27:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrsdztwA9ltUUBomQb+A3Z+9RxA4jU4Ph+2bpEDIuyZ7xOHJxGfykUxMPnV2mynMXra+9d X-Received: by 2002:a05:6402:b15:: with SMTP id bm21mr48028651edb.380.1634596073766; Mon, 18 Oct 2021 15:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596073; cv=none; d=google.com; s=arc-20160816; b=xRyRFays9UVxzdriy/5VD6dYVYsLSoaa68qS8ypgmDkeOZb+4t9HhNIyYwwGRCyob+ kYwhJRGT2qQzK6c4GzSANXp1F4onCEQXtAYFKWjhXc82zmwcCKWui3IEVAuiqQyqNx0S 5HUQZ3H61RUS8nQ3HMUOxefHUChVpqN556w5f9kXKvgv7myz8hlEnVOt4Rnn8jrxTLN2 mTT4mrMTp1VGbGptg5LyjYn8SNPcW3BtzpTfI/WLVaT5VlsO1lhb+jOKvCvIarnwjlRl M1Pp9KKY/PMeLPGHYg26HLSIyQ5MeHDfPNNIr5F9z75om8PhBMKiK4m+ElA/l1PAefTK 8ILw== 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=uYpCM2I+b7+DidcJu2d4tvNuv0mjg1ybGKNADeZrU30=; b=H+Li8nk50vtXsrJ0NdLfdc4GN/0E4K4Caz8qPNSDb2TESWSjvQ8Pot2cwrRBwwxItU SkZbkb1GspcKmXJyN+5B3Jrm9RS7L5bmExruP30TZpgauJ0rTJwT6kKHw7Q7FShcAC7A 8O4UiYKJclTjzET2w9q7shuhvON+vPXM579Po+I6UGASI9VB8bm+8pbcSMdwc1kJrOIU S3Rd5wD0kC2e6PtL8ASCC6wnwNSZTveYDqq6VVE1JufDlR3dk+gmjZgYZhBDbud4AJ6y HiJI86LwGLnNzrZ7fZZOQlOeOQem50ziTPFTeo1Wm8dnxtim09nb5yNTlNypqUaLwgPl UIAw== 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=PB42Qoxe; 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 f15si30344699edf.490.2021.10.18.15.27.52; Mon, 18 Oct 2021 15:27:53 -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=PB42Qoxe; 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 6F7A768A867; Tue, 19 Oct 2021 01:27:30 +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 B982868A4CA for ; Tue, 19 Oct 2021 01:27:22 +0300 (EEST) Received: by mail-pj1-f42.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso493826pjb.4 for ; Mon, 18 Oct 2021 15:27:22 -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=mAFMqIUx2JNxf/AN3DDdplXZytJ0UYRFwt2xxNPoL1s=; b=PB42Qoxe74KaG/3TQ3o8HqGE565fEfu9IzwMqWV7wdrKQs4/SCHXa2fEMtcKkrCGxx BUiHvLkm6aFWtbEUASQft/WSWa1tg/liepYYzTm2HyWbNw5FDVvLSk1wmd//zuxFz2PE wYrT70m7dpTzecIM40PRKa3JZuBnvNiaV9ki2noA302etUSwyJvg3RYRHjwtffl1woD5 hoPi+15z0udRTe0Jy7zQpUlPI+QcqgbzPmGxd8IAmKc2ytForh9MFK9pboiyhmkqH5Qr RmdH4EshN/zg6CD7ODc7GVvrO25eO+o1L8k7ji2PjUAuc/d2mWoLKXehzOr/8Ss8jPh1 B+ZQ== 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=mAFMqIUx2JNxf/AN3DDdplXZytJ0UYRFwt2xxNPoL1s=; b=ltOuynG+PQXY9udbebdHrNrawIS6J7cBwdlMGw5X8ndNIokno0W7sT3sbDZ3LYK0Ij Ss+eXhkNLJpkcybydBu1m8A+v77Sw5kL5rpKXvYvoQlcL+sb6lIA0cP5sXsDn+wT9Y0V H57ivXAnf9QUmiQe35zBlOwFRgBaEYLGDBcnwZN6ax9b+/p+/GgVX2dNSbnMj+blC/3n IcW5oh56OXet9vTOpq74t+FXSPBaIr1u8kxh92g/WuRFKdqEbZiVVzTNqIiDy4a/Ptuz 52K3725AbssZtpYR3tplUl1hs4KO6K1B/9zsMIB6cviLGRIz9GMb3QhhbBlDS5gRKnr7 ZZWA== X-Gm-Message-State: AOAM5306Fj7ZFQTXq9II8rqK/StdhAScraW7XP91TJzzrqiAN+GJ6rbY 9QHMbQOFoQY5HRLyOr1ofO1MV2yu0RZ4a1fShJs= X-Received: by 2002:a17:90a:245:: with SMTP id t5mr1857323pje.133.1634596040729; Mon, 18 Oct 2021 15:27:20 -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 e2sm13953258pfd.137.2021.10.18.15.27.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:20 -0700 (PDT) Message-ID: <95de62e3-a37f-6ecf-eb0d-ad213021e0b0@triularity.org> Date: Mon, 18 Oct 2021 15:27:19 -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: 9FF3SKxjCE0B 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 7362bcdab5..9277aeea38 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -938,7 +938,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 b6fcb3b75e..d34dc52a6b 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 47e7d1fef8..fe7e294bf1 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 01c9f2abbb..f094b2b593 100644 --- a/libavfilter/vf_cover_rect.c +++ b/libavfilter/vf_cover_rect.c @@ -124,7 +124,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 2a88692cbd..14e6430368 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 44f85cb019..73bb3c0738 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -549,7 +549,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;