From patchwork Mon Oct 18 21:31:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31150 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3749510ioa; Mon, 18 Oct 2021 14:31:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9qYnGXNjPMYOg6na3cfbhEc91xlCMurxZU/bMZauIZoecm+pnB+Jv5yLKrEbO0bE5z2D7 X-Received: by 2002:aa7:d444:: with SMTP id q4mr17162997edr.7.1634592711428; Mon, 18 Oct 2021 14:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592711; cv=none; d=google.com; s=arc-20160816; b=IgecnSSZGWx5dYom8AQ3+0m82R8QdI+eO8+uxOo29kwtubHkdyQoqhOl7H7JnEKppJ dQ+qFKZj1kuAe5U4cCG9grBchMYKYXHyUsXySx9k5v5Q5yDrkfFYoOzW0w/u8HE/RgPO C+zVGfy1z0Jb/6+W7s/fxwuDls9tkLcTBevUnfXivTn41ZrG/J7mS9EtCPwJv8AKT6zy SUIbsJfWzvsfM967poi3RJhqzpSjPH29kgY+OCE4RG57qL7Pja90XOfXnV7tMYYaSAl6 xYTQWYp4VeOmLVywZVbw46CuhZkj55gdlrVnElPeK6x8W5lUdeIlf4yfh9SLTY15Iw7s p4Jg== 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=qZIjnP0gwF2X2wxsUlt+aYS2vGvh33JbCBqBt8GXxtM=; b=Zgr6du+yeAmkcAaE7Jecquhn+fI9IbTztVmT6SmXXBvE/dKUxkSbwIzuJ2NpA9KZ/l wDMaPb9GyiXiloZSor0M2ko//kqD1jEp67VuMjwUdWlRbTu6MiP/EgrThXz3U0cK9Xbc g4ZYnOFhk6mbGXXBjF56P29U/bhG2OqwPE6WTI0RHC3Je+zBDBtPrEPRSbYscn5NuVbp JTkKcYmuTOrKO6NyacsTfeOzN0uZpI6hx3wfZA5qmTmdCDi97i6V6iKWvOCTTqdwyMYa IlAComPvVz7LAjR/ObB0YUOPEBmaTjATdpVKbuH2VzdHhUfyg53bfaGPBp/6hO2gPstD nTuA== 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=lKBu7yR7; 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 cu17si21714603ejb.676.2021.10.18.14.31.51; Mon, 18 Oct 2021 14:31:51 -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=lKBu7yR7; 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 F315568A133; Tue, 19 Oct 2021 00:31:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 87D266800A1 for ; Tue, 19 Oct 2021 00:31:40 +0300 (EEST) Received: by mail-pj1-f54.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso405387pjb.4 for ; Mon, 18 Oct 2021 14:31:40 -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=mGFtAjcklBWciTQkec00epnr+bFLthuKzX3Ml1dFJV4=; b=lKBu7yR7lUGm6dSxb8bN/3N3mNBpOzFrgkMnoPuxsXA0Ww3upPME1quO9YGoHvPfmn 11UIHmoOWqjik9mC5zZUv+NWh2Cy4rcdB+YRR+JFrIFObl7g+KJqyDS6q/NcteeVGRdz ftK+ObHcCfzYvouyhrR98hL3UV9mpC4qqgvkb1RKd+nx/nsk1c8mjAyxUoVsEwoT2xqb lWurC0GNh7x/oa1PUxBSRAQDUh6tSPv7SIuBWC7ZTrDR8NrXfHbX4g0xhiSkMZSO8muL Qrdtlx1s78gKFOcIoUA9rwBLj0Rr/kATn5FmUAmeH2Po4G18J8YknSZrNMK55lJi4wzz KGrQ== 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=mGFtAjcklBWciTQkec00epnr+bFLthuKzX3Ml1dFJV4=; b=aTKwkecfmU6rMzaAD7pR/iivUgXL59HvO6RiEKCZXfEiHRPt4XZ56uwDNqA1pMdvox m9C3es0vdysVD9KqVIRrMJ1WyuJjvwaFSZtRix07IsUZcmC0Vdw1Q9cVZG+YD8B+WXOy FeBTugMaAS/gJPr65y/ZvrmCbaVKOZr/5IkhAoxoBqVat2CncbMLSzCzlbh0hCMw/FPt LLh4OD83G48iZdFhWJCsW8Ycr/dFrCYFvXK0WgSxKapqdMqM+dyleYBVAWm69XfcZitr U7t597YHdFbx1kQ+PAWeVIVeKlgBtHD0upF+q2pTG7vuWXQCm1JkVoUclEonf+T32lFp gAxQ== X-Gm-Message-State: AOAM533biv2NI5FnEVJw2IlUaDazBE19faxyN31bVKAIWehjPsD7C6DC qr+ihNrGpXX8TMRRcz9qHLqayLGoUX57PMtJNeg= X-Received: by 2002:a17:902:c20c:b0:13f:5507:bdc8 with SMTP id 12-20020a170902c20c00b0013f5507bdc8mr29608169pll.56.1634592698367; Mon, 18 Oct 2021 14:31:38 -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 l11sm3481357pfu.55.2021.10.18.14.31.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:31:37 -0700 (PDT) Message-ID: Date: Mon, 18 Oct 2021 14:31:36 -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 1/6] doc/examples/metadata.c: 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: egzdPYCPlfuU Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- doc/examples/metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/metadata.c b/doc/examples/metadata.c index b6cfa6bd36..7c44009a24 100644 --- a/doc/examples/metadata.c +++ b/doc/examples/metadata.c @@ -34,7 +34,7 @@ int main (int argc, char **argv) { AVFormatContext *fmt_ctx = NULL; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; int ret; if (argc != 2) { From patchwork Mon Oct 18 21:31:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3749847ioa; Mon, 18 Oct 2021 14:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuzXja+2L2XOIIjzd0PlQ1ZxK26+Bufwvv/1IQTShHcE/8iaVpL+2pA0YYZUmA9VzTD++F X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr49222044edx.371.1634592735811; Mon, 18 Oct 2021 14:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592735; cv=none; d=google.com; s=arc-20160816; b=bpArX8Ufj1Qxh979R7AjETVZbuP79ZOSG4B37wpFSy3kP0JdoS9TaI6iA53+ynXcGb D1V40j3VM+8FYaIqIQD3+ZidhI8EUx7+2pIBb3k4UWd3d6wNNpk9+46ET8Nuar6YVLb3 FnqzvyL72gLB2ZONZOTMWSLn53Zh1n55FLPU7B76XcDMQ38ipBGHhY+3IQxXpNZ90Kpe oPJP0tcJb5isIKdkwkOpRSXCclabCC+/YdoY9L0d9dvdMuIfVnixC3onhy1VPZLTpSS2 wDG3+eRvwnS07H0IPPAd86DpNTSRS/EcJoYAAfrEBLERx2JychL6o6vlw3CDANgWRslb 9Qgg== 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=j8T6wEOEJP7NlpuCgPQgsCZosvJHKkUFreZLYNyYes4=; b=k350d/2tWAOL4mz8EaoKZpDR8/R0msVHkaMwf404f01fLuVANL1J6+ZflLnCtXMV6S b3Iyot6uJmU9h1rGRl6k0SjZPC3EE2hl3Y2cf8YCVnVOlJH+sUejL0qhyC/wRCFx18Lj 8qxDUZGjex++3t+MgTRvGZtf9M0VZ5/I4v0diGrugZGadPcpwXWMGizIEuWl0mV0Z5JP yu9ftVTKIjLeUY2GhuDKAm+C8amX1MU1xRB3yu9gHsKc/hx+XZsOEBL5zzUlN0ZnzC4w 2L+j+ijNzS+FaYBBviSR7HF/n01vwQQGP6fIaWN4pYAul20/I9uzwz+3jne5NcoNg+oe DdJg== 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=U5Mz+nBl; 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 o6si28620607edi.516.2021.10.18.14.32.08; Mon, 18 Oct 2021 14:32:15 -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=U5Mz+nBl; 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 3445968A618; Tue, 19 Oct 2021 00:32:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E541A688113 for ; Tue, 19 Oct 2021 00:31:59 +0300 (EEST) Received: by mail-pj1-f44.google.com with SMTP id lk8-20020a17090b33c800b001a0a284fcc2so425326pjb.2 for ; Mon, 18 Oct 2021 14:31:59 -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=OrqvsHzu6NK+vxiRQH6PfFEJ2LBSvRUzr4dTbo2vfxA=; b=U5Mz+nBlJk125w0G6sur0dTZ9w0e8OPlxVrrgh+nTCoN8rzGnFNpFB2tpCj3yf+Ov5 XlkViBcoaAJh1py3EKoW7xPFaBu890ECBC459OpSKqkSUe/26x1iJH3ZDEVL5mqUm0KB /oDdfT6GAbLnZ4zqq0y7GW1vQGOrXT08ME855TJ0sRFwXLarBdFOyJKJGDYpPfhYEd8f nP4BbrELs1TURQQkit0dFB1xsIEOAVptd57M1dxcfsRhMPm4jJ7hpmx0EeIemAQ7qGjl +AlFqvrCxEAjKPuny+2FukXPtwyhPxcdKAYjQjDKg/SjVsG+w0g+0CNQQzeEAoHaZPrU t6Ow== 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=OrqvsHzu6NK+vxiRQH6PfFEJ2LBSvRUzr4dTbo2vfxA=; b=M/dPzfNyvs8wH+zfPf+iZSse0lTdD6mluRkf03LbLOoNe1EyDsrvtZ3KB0jh3ihLu7 Gh8HWhAqYCPYFtFzdkeH6xbUFReilI9iUi36i9mZ2ST8lLWwS2J9lhHc1/gMjPTc9kDK FTL8GY6smsKUU53xSdjo90FC95xK26Q3pW83mPIfsIlrdlxTWRGM3rz4UkfHKO3oaZ2D u/iNvca1JFfMPraSc3JCKpWjStJDDDEbaqLZ+hTIVYOsOG92NkNgaM/zpDXJvjuGqP7U RkQ0OS8F3LkraW11arb3B7KRrQgV0LzWWDl8uXfbjUExUuGHAfatxCE9iFrU0KD0st3J bfUg== X-Gm-Message-State: AOAM532iVl4w2HTq5HA63Woux9j6LKelQn733gBVJ2LVtvabZ+hBH+42 CwoeZpgzfJXpU3qzeBXOp3XADcUb6nVevAAGjtE= X-Received: by 2002:a17:90b:1112:: with SMTP id gi18mr1629648pjb.136.1634592717876; Mon, 18 Oct 2021 14:31:57 -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 x13sm14122991pgt.80.2021.10.18.14.31.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:31:57 -0700 (PDT) Message-ID: <011d2d7b-79fa-60d9-68ba-64c2087b79d3@triularity.org> Date: Mon, 18 Oct 2021 14:31:56 -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 2/6] fftools/: 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: J5X3HHecvhWX Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- fftools/cmdutils.c | 2 +- fftools/ffmpeg.c | 6 +++--- fftools/ffmpeg_filter.c | 6 +++--- fftools/ffmpeg_opt.c | 8 ++++---- fftools/ffplay.c | 8 ++++---- fftools/ffprobe.c | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 2c8e98982f..d351ceb7fa 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -2106,7 +2106,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec) { AVDictionary *ret = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM : AV_OPT_FLAG_DECODING_PARAM; char prefix = 0; diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 98c2421938..edbf3ac52a 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -677,7 +677,7 @@ static void ffmpeg_cleanup(int ret) void remove_avoptions(AVDictionary **a, AVDictionary *b) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; while ((t = av_dict_get(b, "", t, AV_DICT_IGNORE_SUFFIX))) { av_dict_set(a, t->key, NULL, AV_DICT_MATCH_CASE); @@ -686,7 +686,7 @@ void remove_avoptions(AVDictionary **a, AVDictionary *b) void assert_avoptions(AVDictionary *m) { - AVDictionaryEntry *t; + const AVDictionaryEntry *t; if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key); exit_program(1); @@ -3243,7 +3243,7 @@ static int init_output_stream_streamcopy(OutputStream *ost) static void set_encoder_id(OutputFile *of, OutputStream *ost) { - AVDictionaryEntry *e; + const AVDictionaryEntry *e; uint8_t *encoder_string; int encoder_string_len; diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index b798459946..c70903295f 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -86,7 +86,7 @@ static enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodecContext *enc_ctx static char *choose_pix_fmts(OutputFilter *ofilter) { OutputStream *ost = ofilter->ost; - AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0); + const AVDictionaryEntry *strict_dict = av_dict_get(ost->encoder_opts, "strict", NULL, 0); if (strict_dict) // used by choose_pixel_fmt() and below av_opt_set(ost->enc_ctx, "strict", strict_dict->value, 0); @@ -437,7 +437,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, if ((ofilter->width || ofilter->height) && ofilter->ost->autoscale) { char args[255]; AVFilterContext *filter; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; snprintf(args, sizeof(args), "%d:%d", ofilter->width, ofilter->height); @@ -994,7 +994,7 @@ int configure_filtergraph(FilterGraph *fg) if (simple) { OutputStream *ost = fg->outputs[0]->ost; char args[512]; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; if (filter_nbthreads) { ret = av_opt_set(fg->graph, "threads", filter_nbthreads, 0); diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 1d6d29cfc9..147048e914 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -249,7 +249,7 @@ static int show_hwaccels(void *optctx, const char *opt, const char *arg) /* return a copy of the input with the stream specifiers removed from the keys */ static AVDictionary *strip_specifiers(AVDictionary *dict) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; AVDictionary *ret = NULL; while ((e = av_dict_get(dict, "", e, AV_DICT_IGNORE_SUFFIX))) { @@ -1069,7 +1069,7 @@ static void dump_attachment(AVStream *st, const char *filename) { int ret; AVIOContext *out = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; if (!st->codecpar->extradata_size) { av_log(NULL, AV_LOG_WARNING, "No extradata to dump in stream #%d:%d.\n", @@ -1105,7 +1105,7 @@ static int open_input_file(OptionsContext *o, const char *filename) int err, i, ret; int64_t timestamp; AVDictionary *unused_opts = NULL; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; char * video_codec_name = NULL; char * audio_codec_name = NULL; char *subtitle_codec_name = NULL; @@ -2204,7 +2204,7 @@ static int open_output_file(OptionsContext *o, const char *filename) OutputStream *ost; InputStream *ist; AVDictionary *unused_opts = NULL; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int format_flags = 0; if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) { diff --git a/fftools/ffplay.c b/fftools/ffplay.c index ccea0e4578..1183235624 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -1856,7 +1856,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int nb_pix_fmts = 0; int i, j; @@ -1960,7 +1960,7 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for int channels[2] = { 0, -1 }; AVFilterContext *filt_asrc = NULL, *filt_asink = NULL; char aresample_swr_opts[512] = ""; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; char asrc_args[256]; int ret; @@ -2575,7 +2575,7 @@ static int stream_component_open(VideoState *is, int stream_index) const AVCodec *codec; const char *forced_codec_name = NULL; AVDictionary *opts = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int sample_rate, nb_channels; int64_t channel_layout; int ret = 0; @@ -2760,7 +2760,7 @@ static int read_thread(void *arg) AVPacket *pkt = NULL; int64_t stream_start_time; int pkt_in_play_range = 0; - AVDictionaryEntry *t; + const AVDictionaryEntry *t; SDL_mutex *wait_mutex = SDL_CreateMutex(); int scan_all_pmts_set = 0; int64_t pkt_ts; diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 90e895bbf9..169c26b65c 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -580,7 +580,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, const char *a /* convert options to dictionary */ if (args) { AVDictionary *opts = NULL; - AVDictionaryEntry *opt = NULL; + const AVDictionaryEntry *opt = NULL; if ((ret = av_dict_parse_string(&opts, args, "=", ":", 0)) < 0) { av_log(*wctx, AV_LOG_ERROR, "Failed to parse option string '%s' provided to writer context\n", args); @@ -1836,7 +1836,7 @@ static void writer_register_all(void) static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; int ret = 0; if (!tags) @@ -2364,7 +2364,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, print_int("max_content", metadata->MaxCLL); print_int("max_average", metadata->MaxFALL); } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) { - AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE); + const AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE); if (tag) print_str(tag->key, tag->value); print_int("size", sd->size); @@ -2957,7 +2957,7 @@ static int open_input_file(InputFile *ifile, const char *filename, { int err, i; AVFormatContext *fmt_ctx = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int scan_all_pmts_set = 0; fmt_ctx = avformat_alloc_context(); From patchwork Mon Oct 18 21:32:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31146 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3749891ioa; Mon, 18 Oct 2021 14:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbD4JPCr3M7xgp8HvbyMRUCw4RQrrMJ+k8/6UQHNQYa+R8bAOlXa/vsD667Ilo2AfGRQzp X-Received: by 2002:a17:906:2294:: with SMTP id p20mr34175364eja.224.1634592739404; Mon, 18 Oct 2021 14:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592739; cv=none; d=google.com; s=arc-20160816; b=sz6inVGp/nzHaH9jTTDypB+mbDVzz+S1Rqv/uYCqwnX9V7xTTzTTwkOS4mdInpTYFT 2f3SZb0n8RASQkB5YSsh6atRYCt3+9gFkqO8VyQqzdBNVXMKaXvVhZGCwCvn/JhsYqgD j4oNTXEq9KhOasQy0Jag4AOyly97K2jo+8cIiwE8hHLHsPu27fyOpDjdC7v/WI7VO0zJ UqyUF67+PO3O+URX2VefEukliSgwko+PsnZaYzurIwOiXpr0rvHOOv/QJPMUR78KGyxL AYYR3l4KEaqlmpIYeJLRZVu18dxy6FNZ0rm5JZ2RLBwvaF4wj0LsEn9LhT1w4SOkOShL mbjA== 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=DNAO6hBki4TRALG9Y1PLbP33KHcrESksBn3kC7Ow2nw=; b=Txq9oJW4DN/r1nCH88UKaVdBhYt7suEz7cNND2/wolDijlRUrzx5Q4DXxRRPiJO2NY nqeet4x0sWD2mhRISLOar+B2v6lFmb+Qw34UCDGnIctfryOUPZTtBinz9ld9+qstYxNv gSppt6+KqzTchGhGjgfGMFVjq2C0R/kyoUb6zumOTmY8WF1384lmmWax6wXc2FWnZuwU WwN+Fs4ywBxmcQn1nZ5vbVkzhlC+9PeiJ24dqS6V4T6PtUdw205TMMaTkrvcrxKnFrJs fO3pGI3VeaiCDLtpyaJPZWn3bwTD+vf4TTxpEBIpJV2hIR1oTZ12ghvL0T486cNHnuuN W8Sg== 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="npm80ka/"; 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 di19si11578036ejc.27.2021.10.18.14.32.18; Mon, 18 Oct 2021 14:32:19 -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="npm80ka/"; 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 4EA6168A67E; Tue, 19 Oct 2021 00:32:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 94C63688113 for ; Tue, 19 Oct 2021 00:32:07 +0300 (EEST) Received: by mail-pf1-f181.google.com with SMTP id v8so11645549pfu.11 for ; Mon, 18 Oct 2021 14:32:07 -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=Q/h/qrzBy4wKhiOV+vvdCQfccGbrxokbnk5zn2f77a0=; b=npm80ka/NzX4irG3hdyNRlt17j9aqEU2Qaq3DwwYiRaJ+65KCMi+8wx48N5x1Qy3pA PEjF2v18bqSBzwKH/DmAGQqIejiT2CeHo9yQjdVgNgXVZ42jx2nFgUZXaieHpLY9305q pfGHVcV73SHG2CN1npdrlTNDFHyaFsFCCDX+mHdbW44RU/kTdGn38yfMRTmQf1pNgK4Y Z7+jDP5F6+VsJu/TQsdYwf0I4tDdCz5YHzqWiu/qyvgaObL4KcMihonE5FRQbBp+BFUW de7kY2TfQ5rWKUFta7pCsgRGSlkh0DOlj4x1z0dW4ZjC5T0/ju2Ur2O/X81SY4KmWh6n K6KA== 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=Q/h/qrzBy4wKhiOV+vvdCQfccGbrxokbnk5zn2f77a0=; b=qr6hZCIy2Vqg4WnSKWgCGd/FTT4N5t99vi3y73YPiTF05PJlDSlabX4AKhARWpSwQB hhSVXU734TeXBDXuh/8eJRrikKVvfSFmvWCQPWJdziMsToNRvZHYb4xe22LJMMPcRW2s w38N8GW0V3drqWG7GM6ftxK/9eYgn9uotdCGCdGrfzgZOkU0qhKGqzUc7Zg3G/BbsTKm 5x1PviOf3m5+FtYLRlWMbvvX7oVEflrmuatVdaBW68CO4IvhqLp0ML+Y0sZpC3GBDslL uvYZMVl3US5Oup5KUCbcUtbL12ivWZL3PPrQzEqO0OPVglY5GAsECihiyeHirflHyhgE 6TdA== X-Gm-Message-State: AOAM530ISG0IvzLQmgt3Lop/nKcjSmThxB1p7oJw1/Uk9Tsa7VpuH1dC mUaWFiSBPNO1/kp/B0mZSpXv675wNjlBJ3vQPPA= X-Received: by 2002:a05:6a00:13a5:b0:44c:ae90:8603 with SMTP id t37-20020a056a0013a500b0044cae908603mr30902457pfg.17.1634592725672; Mon, 18 Oct 2021 14:32:05 -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 q16sm6116049pfu.36.2021.10.18.14.32.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:32:05 -0700 (PDT) Message-ID: <47446a10-f735-b9a7-8d7a-732ff707900d@triularity.org> Date: Mon, 18 Oct 2021 14:32:04 -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 3/6] libavcodec/: 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: qRLi29FRn/zx Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavcodec/libaomenc.c | 2 +- libavcodec/libvpxenc.c | 4 ++-- libavcodec/libx264.c | 2 +- libavcodec/libx265.c | 2 +- libavcodec/mjpegdec.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c index 800fda0591..85e8fc0f0b 100644 --- a/libavcodec/libaomenc.c +++ b/libavcodec/libaomenc.c @@ -882,7 +882,7 @@ static av_cold int aom_init(AVCodecContext *avctx, #if AOM_ENCODER_ABI_VERSION >= 23 { - AVDictionaryEntry *en = NULL; + const AVDictionaryEntry *en = NULL; while ((en = av_dict_get(ctx->aom_params, "", en, AV_DICT_IGNORE_SUFFIX))) { int ret = aom_codec_set_option(&ctx->encoder, en->key, en->value); diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 10e5a22fa9..ea92eb6221 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -910,7 +910,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, vpx_codec_caps_t codec_caps = vpx_codec_get_caps(iface); vpx_svc_extra_cfg_t svc_params; #endif - AVDictionaryEntry* en = NULL; + const AVDictionaryEntry* en = NULL; ctx->discard_hdr10_plus = 1; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); @@ -1671,7 +1671,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, if (frame->pict_type == AV_PICTURE_TYPE_I) flags |= VPX_EFLAG_FORCE_KF; if (frame->metadata) { - AVDictionaryEntry* en = av_dict_get(frame->metadata, "vp8-flags", NULL, 0); + const AVDictionaryEntry* en = av_dict_get(frame->metadata, "vp8-flags", NULL, 0); if (en) { flags |= strtoul(en->value, NULL, 10); } diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 0f886713e3..e255432604 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -901,7 +901,7 @@ static av_cold int X264_init(AVCodecContext *avctx) #endif { - AVDictionaryEntry *en = NULL; + const AVDictionaryEntry *en = NULL; while (en = av_dict_get(x4->x264_params, "", en, AV_DICT_IGNORE_SUFFIX)) { if ((ret = x264_param_parse(&x4->params, en->key, en->value)) < 0) { av_log(avctx, AV_LOG_WARNING, diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 7dd70a3450..ec50b8a77f 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -363,7 +363,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) } { - AVDictionaryEntry *en = NULL; + const AVDictionaryEntry *en = NULL; while ((en = av_dict_get(ctx->x265_opts, "", en, AV_DICT_IGNORE_SUFFIX))) { int parse_ret = ctx->api->param_parse(ctx->params, en->key, en->value); diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7f89641660..b22895cfe6 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2407,7 +2407,7 @@ int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) int i, index; int ret = 0; int is16bit; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; s->force_pal8 = 0; 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; From patchwork Mon Oct 18 21:32:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31148 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3750240ioa; Mon, 18 Oct 2021 14:32:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0FBndH8FY43uOa2E2CjhKh/ewfvEKBPIxE8uVBUFa2ACTudFIAJ0n8ozOKXXXcTSz9sI2 X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr48285415edy.350.1634592763971; Mon, 18 Oct 2021 14:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592763; cv=none; d=google.com; s=arc-20160816; b=RFsoBL+XBUFRw0bF7gOVjxB9vrqpaXA6LsRfmIeqtSD/HRTHLa5YNxfmUbNSBLWhOp UhukZOfVBln9bBjhj2ccEfScmlxgSlTtKN1ElPfrVT4g1dwCF1PvTqc/dLvJ3H2RP3kq +/K4Ncf1dhU9yI4hBYGs5Jx6bjLNBJsOAaqd3goRvxCJNgfV7Z903VlWULw/lEDtvgeP VqokoHQtJFZUhf3p+W5G5kBVeWwgxF7QVILdfau0RQ+hvd3yAbuMv1bPmiw3jyRegKFZ K1T7cwCbOr0T9y7UXK9AIhOrgQX3YDPCYroW2S52wBSApuD2jnajzyZ3VNcbsreoLqtL Zv3g== 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=I6hpMBm9pNgboV+ySYagmhG3S7rdeK18fLP51G6k62Y=; b=fCSQ71/VLrpZ8meDWL4cSGEy9ukyR7Va35LTt29gFsK63tta957QG7u2EtggoW4+E8 3cv90t6W6kWNjshsWeCJ/P6uFUqQVopjNU5KcETpm7R0Zf02nFGdBQNRZIscJn5za/Tn jITRsekAsuB7+oNL8Fs9g1l4ya8ZJHt7LT41L+vxhqFgT5i7YvzM51TLqe/FbAWC5cuh B1eI306EOjQo1sCqIZbNhsuWZQ3bf+zaGyx9kYdKyyN7fKT5+mKq2E9Q+JKgAa8fxf4p MtEDJAuPaBpvO6ymSX1Xd7oMrts3XCCTB7Qv2GxpFuKMN2GHJnzFyitVN3i8vBkF5eqG zThQ== 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=385JScGR; 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 hq30si23731214ejc.490.2021.10.18.14.32.43; Mon, 18 Oct 2021 14:32:43 -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=385JScGR; 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 B832B68A733; Tue, 19 Oct 2021 00:32:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5539968A10A for ; Tue, 19 Oct 2021 00:32:33 +0300 (EEST) Received: by mail-pg1-f173.google.com with SMTP id e65so15030773pgc.5 for ; Mon, 18 Oct 2021 14:32:33 -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=RqBX9okpdUycZCbZH9fbNB4I/VGC7pvRwuBRe3oVSw8=; b=385JScGRB14XcZec7k93r0HiYOYL6YTD5Q4G3+P68QFIT6V8UCP8OEKfOSCwzfERv7 SR2HaiIDORq+qLGUIhqCJucZINnqzYboaq3hnYomVdXmYazk0vhyRCb4E71ZBvqj7lz+ AzM4gXtQxj/H7NS1zapJTIcN42Hpx8FVABVlBFJw6fMMvA4AWPaaa09ygFs/fuw173g2 HapV4XlSBqHLUXlci+Velc4GbsvOK3cGc0zlXqnOH5H4jaynB9vq1Fm5/mxO3jeUhplZ bYvaUAe9rpvbQs51tiSaIMilbwfWa6c8kccBSQxzZh4QvMS3Yfgdtc8de+mLzEjvsIu8 EXLg== 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=RqBX9okpdUycZCbZH9fbNB4I/VGC7pvRwuBRe3oVSw8=; b=Jgc06m7d8gtjmJiQS/fRB94ZWuPdhDYLfrAoBQLPnamoTRHF8WcPIemp8l5adJ5VhT vuQLLF54VphhzJwWd6R43uhwWRmsN/ZvU43pYPsTkvpqVqQeI2LKLpRNl4ylPuGXvUAS TaZZvWdZO4EfjIsJpG201JHjo71bI+SdpY+wt+W5txzV9IzBcU271RjYalirqW8G4DM4 g2Akp1cLHS+GsYAtIkl/q21EWkbsNHrwMns/B1RtUYAk4b/ooNFYgn83YKK8lnEes9d9 IiEYUFQQyUh5KuLA+bmXrO4VrVbhbLDaSaOfth5r7uOtv1lXY+xnwM6quAcC8hu/uhY/ KM/g== X-Gm-Message-State: AOAM531+F5Pd1o0SRY82nfsNTiKB9idA+UKriaqPx2cyQKkt+8aKRCWa Opbn3bVi6JTxkGMExp7VorTx2A+C7PlyyxIEiMc= X-Received: by 2002:aa7:9ede:0:b0:44d:13c7:14a7 with SMTP id r30-20020aa79ede000000b0044d13c714a7mr31018033pfq.18.1634592750557; Mon, 18 Oct 2021 14:32:30 -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 c21sm3734918pfv.145.2021.10.18.14.32.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:32:29 -0700 (PDT) Message-ID: <8db31a96-d1a1-2e0b-a14e-3454642a255b@triularity.org> Date: Mon, 18 Oct 2021 14:32:29 -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 5/6] libavformat/: 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: WVO5+8Pm3ZbT Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavformat/aiffenc.c | 2 +- libavformat/apetag.c | 2 +- libavformat/asfenc.c | 8 +++---- libavformat/au.c | 2 +- libavformat/avidec.c | 2 +- libavformat/avienc.c | 2 +- libavformat/avio.c | 4 ++-- libavformat/cafenc.c | 2 +- libavformat/dashenc.c | 6 ++--- libavformat/dvenc.c | 2 +- libavformat/ffmetaenc.c | 2 +- libavformat/fifo.c | 2 +- libavformat/flacdec.c | 2 +- libavformat/flacenc.c | 4 ++-- libavformat/flvdec.c | 2 +- libavformat/flvenc.c | 2 +- libavformat/gxfenc.c | 2 +- libavformat/hls.c | 4 ++-- libavformat/http.c | 8 +++---- libavformat/id3v2.c | 6 ++--- libavformat/id3v2enc.c | 8 +++---- libavformat/matroskadec.c | 2 +- libavformat/metadata.c | 2 +- libavformat/mov.c | 6 ++--- libavformat/movenc.c | 44 ++++++++++++++++++------------------- libavformat/mp3enc.c | 6 ++--- libavformat/mpegtsenc.c | 6 ++--- libavformat/mux.c | 2 +- libavformat/mxfenc.c | 14 ++++++------ libavformat/nutenc.c | 6 ++--- libavformat/riffenc.c | 2 +- libavformat/rmenc.c | 2 +- libavformat/sapenc.c | 2 +- libavformat/sdp.c | 2 +- libavformat/segment.c | 4 ++-- libavformat/smjpegenc.c | 2 +- libavformat/soxenc.c | 2 +- libavformat/ttmlenc.c | 2 +- libavformat/utils.c | 4 ++-- libavformat/vorbiscomment.c | 6 ++--- libavformat/wavenc.c | 4 ++-- libavformat/webmdashenc.c | 28 +++++++++++------------ libavformat/wtvenc.c | 4 ++-- 43 files changed, 113 insertions(+), 113 deletions(-) diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c index 24bc17400e..1f8e0dd670 100644 --- a/libavformat/aiffenc.c +++ b/libavformat/aiffenc.c @@ -82,7 +82,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff) static void put_meta(AVFormatContext *s, const char *key, uint32_t id) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; AVIOContext *pb = s->pb; if (tag = av_dict_get(s->metadata, key, NULL, 0)) { diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 6f82fbe202..d94356f5a0 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -174,7 +174,7 @@ static int string_is_ascii(const uint8_t *str) int ff_ape_write_tag(AVFormatContext *s) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int size, ret, count = 0; AVIOContext *dyn_bc; uint8_t *dyn_buf; diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index a0510df7dc..8632877117 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -355,7 +355,7 @@ static int asf_write_markers(AVFormatContext *s) for (unsigned i = 0; i < s->nb_chapters; i++) { AVChapter *c = s->chapters[i]; - AVDictionaryEntry *t = av_dict_get(c->metadata, "title", NULL, 0); + const AVDictionaryEntry *t = av_dict_get(c->metadata, "title", NULL, 0); int64_t pres_time = av_rescale_q(c->start, c->time_base, scale); uint64_t offset; int32_t send_time = get_send_time(asf, pres_time, &offset); @@ -389,7 +389,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tags[5]; + const AVDictionaryEntry *tags[5]; int header_size, extra_size, extra_size2, wav_extra_size; int has_title, has_aspect_ratio = 0; int metadata_count; @@ -420,7 +420,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, for (unsigned n = 0; n < s->nb_streams; n++) { AVStream *const st = s->streams[n]; AVCodecParameters *const par = st->codecpar; - AVDictionaryEntry *entry; + const AVDictionaryEntry *entry; avpriv_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */ @@ -599,7 +599,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, end_header(pb, hpos); } if (metadata_count) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; hpos = put_header(pb, &ff_asf_extended_content_header); avio_wl16(pb, metadata_count); while ((tag = av_dict_get(s->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { diff --git a/libavformat/au.c b/libavformat/au.c index 9bd408f65c..a408e55e36 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -258,7 +258,7 @@ static int au_get_annotations(AVFormatContext *s, AVBPrint *annotations) }; int cnt = 0; AVDictionary *m = s->metadata; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; for (int i = 0; i < FF_ARRAY_ELEMS(keys); i++) { t = av_dict_get(m, keys[i], NULL, 0); diff --git a/libavformat/avidec.c b/libavformat/avidec.c index b09a715d86..8bf0d3a1fe 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -491,7 +491,7 @@ static int avi_read_header(AVFormatContext *s) uint64_t list_end = 0; int64_t pos; int ret; - AVDictionaryEntry *dict_entry; + const AVDictionaryEntry *dict_entry; avi->stream_index = -1; diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 3b11841cd3..0d01a45d0a 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -263,7 +263,7 @@ static int avi_write_header(AVFormatContext *s) AVCodecParameters *video_par; AVStream *video_st = NULL; int64_t list1, list2, strh, strf; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int padding; if (s->nb_streams > AVI_MAX_STREAM_COUNT) { diff --git a/libavformat/avio.c b/libavformat/avio.c index 4846bbd8c6..2e45c5b5d1 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -167,7 +167,7 @@ int ffurl_connect(URLContext *uc, AVDictionary **options) { int err; AVDictionary *tmp_opts = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; if (!options) options = &tmp_opts; @@ -309,7 +309,7 @@ int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, URLContext *parent) { AVDictionary *tmp_opts = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; int ret = ffurl_alloc(puc, filename, flags, int_cb); if (ret < 0) return ret; diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c index 412b3230e3..8a06e5a46b 100644 --- a/libavformat/cafenc.c +++ b/libavformat/cafenc.c @@ -106,7 +106,7 @@ static int caf_write_header(AVFormatContext *s) AVIOContext *pb = s->pb; AVCodecParameters *par = s->streams[0]->codecpar; CAFContext *caf = s->priv_data; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; unsigned int codec_tag = ff_codec_get_tag(ff_codec_caf_tags, par->codec_id); int64_t chunk_size = 0; int frame_size = par->frame_size; diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 06bbf36c95..a8ba8ec2ac 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -794,7 +794,7 @@ static int write_adaptation_set(AVFormatContext *s, AVIOContext *out, int as_ind { DASHContext *c = s->priv_data; AdaptationSet *as = &c->as[as_index]; - AVDictionaryEntry *lang, *role; + const AVDictionaryEntry *lang, *role; int i; avio_printf(out, "\t\turl); int use_rename = proto && !strcmp(proto, "file"); static unsigned int warned_non_file = 0; - AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); + const AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); AVDictionary *opts = NULL; if (!use_rename && !warned_non_file++) @@ -1366,7 +1366,7 @@ static int write_manifest(AVFormatContext *s, int final) static int dict_copy_entry(AVDictionary **dst, const AVDictionary *src, const char *key) { - AVDictionaryEntry *entry = av_dict_get(src, key, NULL, 0); + const AVDictionaryEntry *entry = av_dict_get(src, key, NULL, 0); if (entry) av_dict_set(dst, key, entry->value, AV_DICT_DONT_OVERWRITE); return 0; diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 9a853ba7ce..7061be656d 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -384,7 +384,7 @@ static int dv_write_header(AVFormatContext *s) { AVRational rate; DVMuxContext *dvc = s->priv_data; - AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); if (!dv_init_mux(s)) { av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n" diff --git a/libavformat/ffmetaenc.c b/libavformat/ffmetaenc.c index edd66e1a04..1d72b43b86 100644 --- a/libavformat/ffmetaenc.c +++ b/libavformat/ffmetaenc.c @@ -40,7 +40,7 @@ static void write_escape_str(AVIOContext *s, const uint8_t *str) static void write_tags(AVIOContext *s, AVDictionary *m) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) { write_escape_str(s, t->key); avio_w8(s, '='); diff --git a/libavformat/fifo.c b/libavformat/fifo.c index 51d7fa5b94..e9d73cb4d4 100644 --- a/libavformat/fifo.c +++ b/libavformat/fifo.c @@ -147,7 +147,7 @@ static int fifo_thread_write_header(FifoThreadContext *ctx) // Check for options unrecognized by underlying muxer if (format_options) { - AVDictionaryEntry *entry = NULL; + const AVDictionaryEntry *entry = NULL; while ((entry = av_dict_get(format_options, "", entry, AV_DICT_IGNORE_SUFFIX))) av_log(avf2, AV_LOG_ERROR, "Unknown option '%s'\n", entry->key); ret = AVERROR(EINVAL); diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 04d3cadf1c..826ccbe303 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -173,7 +173,7 @@ static int flac_read_header(AVFormatContext *s) } /* process supported blocks other than STREAMINFO */ if (metadata_type == FLAC_METADATA_TYPE_VORBIS_COMMENT) { - AVDictionaryEntry *chmask; + const AVDictionaryEntry *chmask; ret = ff_vorbis_comment(s, &s->metadata, buffer, metadata_size, 1); if (ret < 0) { diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index 44c9341493..70e120e291 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -83,7 +83,7 @@ static int flac_write_picture(struct AVFormatContext *s, AVPacket *pkt) AVIOContext *pb = s->pb; const AVPixFmtDescriptor *pixdesc; const CodecMime *mime = ff_id3v2_mime_tags; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; const char *mimetype = NULL, *desc = ""; const AVStream *st = s->streams[pkt->stream_index]; int i, mimelen, desclen, type = 0, blocklen; @@ -241,7 +241,7 @@ static int flac_init(struct AVFormatContext *s) if (par->channel_layout && !(par->channel_layout & ~0x3ffffULL) && !ff_flac_is_native_layout(par->channel_layout)) { - AVDictionaryEntry *chmask = av_dict_get(s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", + const AVDictionaryEntry *chmask = av_dict_get(s->metadata, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0); if (chmask) { diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 44a7e5f93c..d9567f4e21 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -1267,7 +1267,7 @@ retry_duration: } if (type == 0 && (!st->codecpar->extradata || st->codecpar->codec_id == AV_CODEC_ID_AAC || st->codecpar->codec_id == AV_CODEC_ID_H264)) { - AVDictionaryEntry *t; + const AVDictionaryEntry *t; if (st->codecpar->extradata) { if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 3f24c7e192..78f4433ee9 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -278,7 +278,7 @@ static void write_metadata(AVFormatContext *s, unsigned int ts) int write_duration_filesize = !(flv->flags & FLV_NO_DURATION_FILESIZE); int metadata_count = 0; int64_t metadata_count_pos; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; /* write meta_tag */ avio_w8(pb, FLV_TAG_TYPE_META); // tag type META diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 8cc3bd456e..1053126b32 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -689,7 +689,7 @@ static int gxf_write_header(AVFormatContext *s) uint8_t tracks[255] = {0}; int i, media_info = 0; int ret; - AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) { av_log(s, AV_LOG_ERROR, "gxf muxer does not support streamed output, patch welcome\n"); diff --git a/libavformat/hls.c b/libavformat/hls.c index 9fd4ad9f32..4a9fc55fa8 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1063,8 +1063,8 @@ static void parse_id3(AVFormatContext *s, AVIOContext *pb, static int id3_has_changed_values(struct playlist *pls, AVDictionary *metadata, ID3v2ExtraMetaAPIC *apic) { - AVDictionaryEntry *entry = NULL; - AVDictionaryEntry *oldentry; + const AVDictionaryEntry *entry = NULL; + const AVDictionaryEntry *oldentry; /* check that no keys have changed values */ while ((entry = av_dict_get(metadata, "", entry, AV_DICT_IGNORE_SUFFIX))) { oldentry = av_dict_get(pls->id3_initial, entry->key, NULL, AV_DICT_MATCH_CASE); diff --git a/libavformat/http.c b/libavformat/http.c index 476b9a8456..a1372b585a 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -883,7 +883,7 @@ static int parse_set_cookie(const char *set_cookie, AVDictionary **dict) static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies) { AVDictionary *new_params = NULL; - AVDictionaryEntry *e, *cookie_entry; + const AVDictionaryEntry *e, *cookie_entry; char *eql, *name; // ensure the cookie is parsable @@ -901,7 +901,7 @@ static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies) if ((e = av_dict_get(new_params, "expires", NULL, 0)) && e->value) { struct tm new_tm = {0}; if (!parse_set_cookie_expiry_time(e->value, &new_tm)) { - AVDictionaryEntry *e2; + const AVDictionaryEntry *e2; // if the cookie has already expired ignore it if (av_timegm(&new_tm) < av_gettime() / 1000000) { @@ -944,7 +944,7 @@ static int parse_cookie(HTTPContext *s, const char *p, AVDictionary **cookies) static int cookie_string(AVDictionary *dict, char **cookies) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int len = 1; // determine how much memory is needed for the cookies string @@ -1141,7 +1141,7 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path, *cookies = NULL; while ((cookie = av_strtok(next, "\n", &saveptr)) && !ret) { AVDictionary *cookie_params = NULL; - AVDictionaryEntry *cookie_entry, *e; + const AVDictionaryEntry *cookie_entry, *e; next = NULL; // store the cookie in a dict in case it is updated in the response diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index ff27c062e5..cc4f103614 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -535,9 +535,9 @@ static int is_number(const char *str) return !*str; } -static AVDictionaryEntry *get_date_tag(AVDictionary *m, const char *tag) +static const AVDictionaryEntry *get_date_tag(AVDictionary *m, const char *tag) { - AVDictionaryEntry *t; + const AVDictionaryEntry *t; if ((t = av_dict_get(m, tag, NULL, AV_DICT_MATCH_CASE)) && strlen(t->value) == 4 && is_number(t->value)) return t; @@ -546,7 +546,7 @@ static AVDictionaryEntry *get_date_tag(AVDictionary *m, const char *tag) static void merge_date(AVDictionary **m) { - AVDictionaryEntry *t; + const AVDictionaryEntry *t; char date[17] = { 0 }; // YYYY-MM-DD hh:mm if (!(t = get_date_tag(*m, "TYER")) && diff --git a/libavformat/id3v2enc.c b/libavformat/id3v2enc.c index 5d821ea4db..fbfc5ff82b 100644 --- a/libavformat/id3v2enc.c +++ b/libavformat/id3v2enc.c @@ -149,7 +149,7 @@ static int id3v2_put_priv(ID3v2EncContext *id3, AVIOContext *avioc, const char * return len + ID3v2_HEADER_SIZE; } -static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictionaryEntry *t, +static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, const AVDictionaryEntry *t, const char table[][4], enum ID3v2Encoding enc) { uint32_t tag; @@ -166,7 +166,7 @@ static int id3v2_check_write_tag(ID3v2EncContext *id3, AVIOContext *pb, AVDictio static void id3v2_3_metadata_split_date(AVDictionary **pm) { - AVDictionaryEntry *mtag = NULL; + const AVDictionaryEntry *mtag = NULL; AVDictionary *dst = NULL; const char *key, *value; char year[5] = {0}, day_month[5] = {0}; @@ -219,7 +219,7 @@ void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, static int write_metadata(AVIOContext *pb, AVDictionary **metadata, ID3v2EncContext *id3, int enc) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int ret; ff_metadata_conv(metadata, ff_id3v2_34_metadata_conv, NULL); @@ -351,7 +351,7 @@ int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3) int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt) { AVStream *st = s->streams[pkt->stream_index]; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; AVIOContext *dyn_buf; uint8_t *buf; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 500c83ac3a..8979d10973 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2051,7 +2051,7 @@ static int matroska_parse_flac(AVFormatContext *s, /* check for the channel mask */ if (block_type == FLAC_METADATA_TYPE_VORBIS_COMMENT) { AVDictionary *dict = NULL; - AVDictionaryEntry *chmask; + const AVDictionaryEntry *chmask; ff_vorbis_comment(s, &dict, p, block_size, 0); chmask = av_dict_get(dict, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", NULL, 0); diff --git a/libavformat/metadata.c b/libavformat/metadata.c index b9b6de7972..e2fe4332b1 100644 --- a/libavformat/metadata.c +++ b/libavformat/metadata.c @@ -29,7 +29,7 @@ void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, /* TODO: use binary search to look up the two conversion tables if the tables are getting big enough that it would matter speed wise */ const AVMetadataConv *sc, *dc; - AVDictionaryEntry *mtag = NULL; + const AVDictionaryEntry *mtag = NULL; AVDictionary *dst = NULL; const char *key; diff --git a/libavformat/mov.c b/libavformat/mov.c index d0b8b2595b..22168f0f4e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2155,7 +2155,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb, int bits_per_sample, flags; uint16_t version = avio_rb16(pb); uint32_t id = 0; - AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE); + const AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE); avio_rb16(pb); /* revision level */ id = avio_rl32(pb); /* vendor */ @@ -7451,7 +7451,7 @@ static void export_orphan_timecode(AVFormatContext *s) if (st->codecpar->codec_tag == MKTAG('t','m','c','d') && !tmcd_is_referenced(s, i + 1)) { - AVDictionaryEntry *tcr = av_dict_get(st->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *tcr = av_dict_get(st->metadata, "timecode", NULL, 0); if (tcr) { av_dict_set(&s->metadata, "timecode", tcr->value, 0); break; @@ -7614,7 +7614,7 @@ static int mov_read_header(AVFormatContext *s) AVStream *st = s->streams[i]; MOVStreamContext *sc = st->priv_data; if (sc->timecode_track > 0) { - AVDictionaryEntry *tcr; + const AVDictionaryEntry *tcr; int tmcd_st_id = -1; for (j = 0; j < s->nb_streams; j++) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 1a2f24c410..bc9e77a44c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2088,7 +2088,7 @@ static int mov_write_mdcv_tag(AVIOContext *pb, MOVTrack *track) static void find_compressor(char * compressor_name, int len, MOVTrack *track) { - AVDictionaryEntry *encoder; + const AVDictionaryEntry *encoder; int xdcam_res = (track->par->width == 1280 && track->par->height == 720) || (track->par->width == 1440 && track->par->height == 1080) || (track->par->width == 1920 && track->par->height == 1080); @@ -2347,7 +2347,7 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track) #if 1 int frame_duration; int nb_frames; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; if (!track->st->avg_frame_rate.num || !track->st->avg_frame_rate.den) { av_log(NULL, AV_LOG_ERROR, "avg_frame_rate not set for tmcd track.\n"); @@ -2840,7 +2840,7 @@ static int mov_write_hdlr_tag(AVFormatContext *s, AVIOContext *pb, MOVTrack *tra // hdlr.name is used by some players to identify the content title // of the track. So if an alternate handler description is // specified, use it. - AVDictionaryEntry *t; + const AVDictionaryEntry *t; t = av_dict_get(track->st->metadata, "handler_name", NULL, 0); if (t && utf8len(t->value)) descr = t->value; @@ -3312,7 +3312,7 @@ static int mov_write_track_metadata(AVIOContext *pb, AVStream *st, const char *tag, const char *str) { int64_t pos = avio_tell(pb); - AVDictionaryEntry *t = av_dict_get(st->metadata, str, NULL, 0); + const AVDictionaryEntry *t = av_dict_get(st->metadata, str, NULL, 0); if (!t || !utf8len(t->value)) return 0; @@ -3565,11 +3565,11 @@ static int mov_write_string_tag(AVIOContext *pb, const char *name, return size; } -static AVDictionaryEntry *get_metadata_lang(AVFormatContext *s, +static const AVDictionaryEntry *get_metadata_lang(AVFormatContext *s, const char *tag, int *lang) { int l, len, len2; - AVDictionaryEntry *t, *t2 = NULL; + const AVDictionaryEntry *t, *t2 = NULL; char tag2[16]; *lang = 0; @@ -3595,7 +3595,7 @@ static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb, int long_style) { int lang; - AVDictionaryEntry *t = get_metadata_lang(s, tag, &lang); + const AVDictionaryEntry *t = get_metadata_lang(s, tag, &lang); if (!t) return 0; return mov_write_string_tag(pb, name, t->value, lang, long_style); @@ -3604,7 +3604,7 @@ static int mov_write_string_metadata(AVFormatContext *s, AVIOContext *pb, /* iTunes bpm number */ static int mov_write_tmpo_tag(AVIOContext *pb, AVFormatContext *s) { - AVDictionaryEntry *t = av_dict_get(s->metadata, "tmpo", NULL, 0); + const AVDictionaryEntry *t = av_dict_get(s->metadata, "tmpo", NULL, 0); int size = 0, tmpo = t ? atoi(t->value) : 0; if (tmpo) { size = 26; @@ -3626,7 +3626,7 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb) int64_t pos = avio_tell(pb); double latitude, longitude, altitude; int32_t latitude_fix, longitude_fix, altitude_fix; - AVDictionaryEntry *t = get_metadata_lang(s, "location", &lang); + const AVDictionaryEntry *t = get_metadata_lang(s, "location", &lang); const char *ptr, *place = ""; char *end; static const char *astronomical_body = "earth"; @@ -3674,7 +3674,7 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb) static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s, int disc) { - AVDictionaryEntry *t = av_dict_get(s->metadata, + const AVDictionaryEntry *t = av_dict_get(s->metadata, disc ? "disc" : "track", NULL, 0); int size = 0, track = t ? atoi(t->value) : 0; @@ -3702,7 +3702,7 @@ static int mov_write_int8_metadata(AVFormatContext *s, AVIOContext *pb, const char *name, const char *tag, int len) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; uint8_t num; int size = 24 + len; @@ -3811,7 +3811,7 @@ static int mov_write_mdta_hdlr_tag(AVIOContext *pb, MOVMuxContext *mov, static int mov_write_mdta_keys_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int64_t pos = avio_tell(pb); int64_t curpos, entry_pos; int count = 0; @@ -3840,7 +3840,7 @@ static int mov_write_mdta_keys_tag(AVIOContext *pb, MOVMuxContext *mov, static int mov_write_mdta_ilst_tag(AVIOContext *pb, MOVMuxContext *mov, AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int64_t pos = avio_tell(pb); int count = 1; /* keys are 1-index based */ @@ -3885,7 +3885,7 @@ static int mov_write_raw_metadata_tag(AVFormatContext *s, AVIOContext *pb, const char *name, const char *key) { int len; - AVDictionaryEntry *t; + const AVDictionaryEntry *t; if (!(t = av_dict_get(s->metadata, key, NULL, 0))) return 0; @@ -3923,7 +3923,7 @@ static int mov_write_3gp_udta_tag(AVIOContext *pb, AVFormatContext *s, const char *tag, const char *str) { int64_t pos = avio_tell(pb); - AVDictionaryEntry *t = av_dict_get(s->metadata, str, NULL, 0); + const AVDictionaryEntry *t = av_dict_get(s->metadata, str, NULL, 0); if (!t || !utf8len(t->value)) return 0; avio_wb32(pb, 0); /* size */ @@ -3954,7 +3954,7 @@ static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s) for (i = 0; i < nb_chapters; i++) { AVChapter *c = s->chapters[i]; - AVDictionaryEntry *t; + const AVDictionaryEntry *t; avio_wb64(pb, av_rescale_q(c->start, c->time_base, (AVRational){1,10000000})); if ((t = av_dict_get(c->metadata, "title", NULL, 0))) { @@ -4040,7 +4040,7 @@ static void mov_write_psp_udta_tag(AVIOContext *pb, static int mov_write_uuidusmt_tag(AVIOContext *pb, AVFormatContext *s) { - AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); + const AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0); int64_t pos, pos2; if (title) { @@ -4277,7 +4277,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat char track_name_buf[32] = { 0 }; AVStream *st = track->st; - AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0); + const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0); if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && !is_cover_image(st)) { type = "video"; @@ -6266,7 +6266,7 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum) for (i = 0; i < s->nb_chapters; i++) { AVChapter *c = s->chapters[i]; - AVDictionaryEntry *t; + const AVDictionaryEntry *t; int64_t end = av_rescale_q(c->end, c->time_base, (AVRational){1,mov->movie_timescale}); pkt->pts = pkt->dts = av_rescale_q(c->start, c->time_base, (AVRational){1,mov->movie_timescale}); @@ -6630,13 +6630,13 @@ static int mov_init(AVFormatContext *s) if ( mov->write_tmcd == -1 && (mov->mode == MODE_MOV || mov->mode == MODE_MP4) || mov->write_tmcd == 1) { - AVDictionaryEntry *global_tcr = av_dict_get(s->metadata, "timecode", + const AVDictionaryEntry *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0); /* +1 tmcd track for each video stream with a timecode */ for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; - AVDictionaryEntry *t = global_tcr; + const AVDictionaryEntry *t = global_tcr; if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && (t || (t=av_dict_get(st->metadata, "timecode", NULL, 0)))) { AVTimecode tc; @@ -6696,7 +6696,7 @@ static int mov_init(AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { AVStream *st= s->streams[i]; MOVTrack *track= &mov->tracks[i]; - AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0); + const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL,0); track->st = st; track->par = st->codecpar; diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index c8328b8b9d..79c4b8ef9e 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -40,7 +40,7 @@ static int id3v1_set_string(AVFormatContext *s, const char *key, uint8_t *buf, int buf_size) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; if ((tag = av_dict_get(s->metadata, key, NULL, 0))) av_strlcpy(buf, tag->value, buf_size); return !!tag; @@ -49,7 +49,7 @@ static int id3v1_set_string(AVFormatContext *s, const char *key, // refer to: http://id3.org/ID3v1 static int id3v1_create_tag(AVFormatContext *s, uint8_t *buf) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; int i, count = 0; memset(buf, 0, ID3v1_TAG_SIZE); /* fail safe */ @@ -144,7 +144,7 @@ static int mp3_write_xing(AVFormatContext *s) { MP3Context *mp3 = s->priv_data; AVCodecParameters *par = s->streams[mp3->audio_stream_idx]->codecpar; - AVDictionaryEntry *enc = av_dict_get(s->streams[mp3->audio_stream_idx]->metadata, "encoder", NULL, 0); + const AVDictionaryEntry *enc = av_dict_get(s->streams[mp3->audio_stream_idx]->metadata, "encoder", NULL, 0); AVIOContext *dyn_ctx; int32_t header; MPADecodeHeader mpah; diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 98dac17994..b9d34d1584 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -515,7 +515,7 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; MpegTSWriteStream *ts_st = st->priv_data; - AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); + const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); const char default_language[] = "und"; const char *language = lang && strlen(lang->value) >= 3 ? lang->value : default_language; enum AVCodecID codec_id = st->codecpar->codec_id; @@ -965,7 +965,7 @@ static MpegTSService *mpegts_add_service(AVFormatContext *s, int sid, { MpegTSWrite *ts = s->priv_data; MpegTSService *service; - AVDictionaryEntry *title, *provider; + const AVDictionaryEntry *title, *provider; char default_service_name[32]; const char *service_name; const char *provider_name; @@ -1067,7 +1067,7 @@ static void select_pcr_streams(AVFormatContext *s) static int mpegts_init(AVFormatContext *s) { MpegTSWrite *ts = s->priv_data; - AVDictionaryEntry *provider; + const AVDictionaryEntry *provider; const char *provider_name; int i, j; int ret; diff --git a/libavformat/mux.c b/libavformat/mux.c index 2053a5636e..28e0f5639a 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -227,7 +227,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options) FFFormatContext *const si = ffformatcontext(s); AVDictionary *tmp = NULL; const AVOutputFormat *of = s->oformat; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; int ret = 0; if (options) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 56facbe4b7..846956142f 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -759,9 +759,9 @@ static void mxf_write_identification(AVFormatContext *s) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *com_entry = av_dict_get(s->metadata, "company_name", NULL, 0); - AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); - AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); + const AVDictionaryEntry *com_entry = av_dict_get(s->metadata, "company_name", NULL, 0); + const AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); + const AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); const char *company = com_entry ? com_entry->value : "FFmpeg"; const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFORM_IDENT; @@ -1540,7 +1540,7 @@ static int mxf_write_tagged_value(AVFormatContext *s, const char* name, const ch static int mxf_write_user_comments(AVFormatContext *s, const AVDictionary *m) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int count = 0; while ((t = av_dict_get(m, "comment_", t, AV_DICT_IGNORE_SUFFIX))) { @@ -1680,7 +1680,7 @@ static int mxf_write_essence_container_data(AVFormatContext *s) static int mxf_write_header_metadata_sets(AVFormatContext *s) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *entry = NULL; + const AVDictionaryEntry *entry = NULL; AVStream *st = NULL; int i; MXFPackage packages[3] = {{0}}; @@ -2479,7 +2479,7 @@ static void mxf_gen_umid(AVFormatContext *s) static int mxf_init_timecode(AVFormatContext *s, AVStream *st, AVRational tbc) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); if (!ff_mxf_get_content_package_rate(tbc)) { if (s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { @@ -2655,7 +2655,7 @@ static int mxf_write_header(AVFormatContext *s) if (ret < 0) return ret; } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { - AVDictionaryEntry *e = av_dict_get(st->metadata, "data_type", NULL, 0); + const AVDictionaryEntry *e = av_dict_get(st->metadata, "data_type", NULL, 0); if (e && !strcmp(e->value, "vbi_vanc_smpte_436M")) { sc->index = INDEX_S436M; } else { diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 7977980935..54727f21bc 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -494,7 +494,7 @@ static int add_info(AVIOContext *bc, const char *type, const char *value) static int write_globalinfo(NUTContext *nut, AVIOContext *bc) { AVFormatContext *s = nut->avf; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; int count = 0, dyn_size; @@ -522,7 +522,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc) static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) { AVFormatContext *s= nut->avf; AVStream* st = s->streams[stream_id]; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf=NULL; int count=0, dyn_size, i; @@ -565,7 +565,7 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id) { AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVChapter *ch = nut->avf->chapters[id]; int ret, dyn_size, count = 0; diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index ffccfa3d48..be66c7bdce 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -337,7 +337,7 @@ void ff_riff_write_info(AVFormatContext *s) AVIOContext *pb = s->pb; int i; int64_t list_pos; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; ff_metadata_conv(&s->metadata, ff_riff_info_conv, NULL); diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index 1b2b0ecf38..d0b76b7a54 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -76,7 +76,7 @@ static int rv10_write_header(AVFormatContext *ctx, int nb_packets, packet_total_size, packet_max_size, size, packet_avg_size, i; int bit_rate, v, duration, flags; int data_offset; - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; ffio_wfourcc(s, ".RMF"); avio_wb32(s,18); /* header size */ diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c index 9319ee6f80..0c0e17d986 100644 --- a/libavformat/sapenc.c +++ b/libavformat/sapenc.c @@ -76,7 +76,7 @@ static int sap_write_header(AVFormatContext *s) struct sockaddr_storage localaddr; socklen_t addrlen = sizeof(localaddr); int udp_fd; - AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0); + const AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0); if (!ff_network_init()) return AVERROR(EIO); diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 1200e553f9..2d8f61f9b8 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -757,7 +757,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) { - AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0); + const AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0); struct sdp_session_level s = { 0 }; int i, j, port, ttl, is_multicast, index = 0; char dst[32], dst_type[5]; diff --git a/libavformat/segment.c b/libavformat/segment.c index 2b024fd373..b11a183322 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -349,7 +349,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) int ret = 0; AVTimecode tc; AVRational rate; - AVDictionaryEntry *tcr; + const AVDictionaryEntry *tcr; char buf[AV_TIMECODE_STR_SIZE]; int i; int err; @@ -435,7 +435,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) char st_buf[AV_TIMECODE_STR_SIZE]; AVTimecode st_tc; AVRational st_rate = s->streams[i]->avg_frame_rate; - AVDictionaryEntry *st_tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *st_tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0); if (st_tcr) { if ((av_timecode_init_from_string(&st_tc, st_rate, st_tcr->value, s) < 0)) { av_log(s, AV_LOG_WARNING, "Could not increment stream %d timecode, error occurred during timecode creation.\n", i); diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c index ac5576fa76..56d00c1d1b 100644 --- a/libavformat/smjpegenc.c +++ b/libavformat/smjpegenc.c @@ -34,7 +34,7 @@ typedef struct SMJPEGMuxContext { static int smjpeg_write_header(AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *pb = s->pb; int n, tag; diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c index e24501bacd..9b934f9f6e 100644 --- a/libavformat/soxenc.c +++ b/libavformat/soxenc.c @@ -46,7 +46,7 @@ static int sox_write_header(AVFormatContext *s) SoXContext *sox = s->priv_data; AVIOContext *pb = s->pb; AVCodecParameters *par = s->streams[0]->codecpar; - AVDictionaryEntry *comment; + const AVDictionaryEntry *comment; size_t comment_len = 0, comment_size; comment = av_dict_get(s->metadata, "comment", NULL, 0); diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c index 896fc81958..21aa8e4ed5 100644 --- a/libavformat/ttmlenc.c +++ b/libavformat/ttmlenc.c @@ -135,7 +135,7 @@ static int ttml_write_header(AVFormatContext *ctx) AVStream *st = ctx->streams[0]; AVIOContext *pb = ctx->pb; - AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, + const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); const char *printed_lang = (lang && lang->value) ? lang->value : ""; diff --git a/libavformat/utils.c b/libavformat/utils.c index 509c0ecdce..5aaee9abb0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1434,7 +1434,7 @@ static int match_stream_specifier(AVFormatContext *s, AVStream *st, return AVERROR(EINVAL); return match && (stream_id == st->id); } else if (*spec == 'm' && *(spec + 1) == ':') { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; char *key, *val; int ret; @@ -1809,7 +1809,7 @@ int ff_is_http_proto(const char *filename) { int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds) { - AVDictionaryEntry *entry; + const AVDictionaryEntry *entry; int64_t parsed_timestamp; int ret; if ((entry = av_dict_get(s->metadata, "creation_time", NULL, 0))) { diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index 13ee065a44..0340465f57 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -45,7 +45,7 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string len += strlen(vendor_string); if (chapters && nb_chapters) { for (int i = 0; i < nb_chapters; i++) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; len += 4 + 12 + 1 + 10; while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); @@ -54,7 +54,7 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string } } if (m) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { len += 4 +strlen(tag->key) + 1 + strlen(tag->value); } @@ -77,7 +77,7 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, } if (m) { int count = av_dict_count(m) + cm_count; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; avio_wl32(pb, count); while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { int64_t len1 = strlen(tag->key); diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c index 2317700be1..c1189aa3ac 100644 --- a/libavformat/wavenc.c +++ b/libavformat/wavenc.c @@ -88,7 +88,7 @@ typedef struct WAVMuxContext { #if CONFIG_WAV_MUXER static inline void bwf_write_bext_string(AVFormatContext *s, const char *key, int maxlen) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; size_t len = 0; if (tag = av_dict_get(s->metadata, key, NULL, 0)) { @@ -102,7 +102,7 @@ static inline void bwf_write_bext_string(AVFormatContext *s, const char *key, in static void bwf_write_bext_chunk(AVFormatContext *s) { - AVDictionaryEntry *tmp_tag; + const AVDictionaryEntry *tmp_tag; uint64_t time_reference = 0; int64_t bext = ff_start_tag(s->pb, "bext"); diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index cf69bd35b1..0dfc75c33d 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -68,7 +68,7 @@ static double get_duration(AVFormatContext *s) int i = 0; double max = 0.0; for (i = 0; i < s->nb_streams; i++) { - AVDictionaryEntry *duration = av_dict_get(s->streams[i]->metadata, + const AVDictionaryEntry *duration = av_dict_get(s->streams[i]->metadata, DURATION, NULL, 0); if (!duration || atof(duration->value) < 0) continue; if (atof(duration->value) > max) max = atof(duration->value); @@ -127,11 +127,11 @@ static void write_footer(AVFormatContext *s) static int subsegment_alignment(AVFormatContext *s, const AdaptationSet *as) { int i; - AVDictionaryEntry *gold = av_dict_get(s->streams[as->streams[0]]->metadata, + const AVDictionaryEntry *gold = av_dict_get(s->streams[as->streams[0]]->metadata, CUE_TIMESTAMPS, NULL, 0); if (!gold) return 0; for (i = 1; i < as->nb_streams; i++) { - AVDictionaryEntry *ts = av_dict_get(s->streams[as->streams[i]]->metadata, + const AVDictionaryEntry *ts = av_dict_get(s->streams[as->streams[i]]->metadata, CUE_TIMESTAMPS, NULL, 0); if (!ts || !av_strstart(ts->value, gold->value, NULL)) return 0; } @@ -142,13 +142,13 @@ static int bitstream_switching(AVFormatContext *s, const AdaptationSet *as) { int i; const AVStream *gold_st = s->streams[as->streams[0]]; - AVDictionaryEntry *gold_track_num = av_dict_get(gold_st->metadata, + const AVDictionaryEntry *gold_track_num = av_dict_get(gold_st->metadata, TRACK_NUMBER, NULL, 0); AVCodecParameters *gold_par = gold_st->codecpar; if (!gold_track_num) return 0; for (i = 1; i < as->nb_streams; i++) { const AVStream *st = s->streams[as->streams[i]]; - AVDictionaryEntry *track_num = av_dict_get(st->metadata, + const AVDictionaryEntry *track_num = av_dict_get(st->metadata, TRACK_NUMBER, NULL, 0); AVCodecParameters *par = st->codecpar; if (!track_num || @@ -174,7 +174,7 @@ static int write_representation(AVFormatContext *s, AVStream *st, char *id, WebMDashMuxContext *w = s->priv_data; AVIOContext *pb = s->pb; const AVCodecParameters *par = st->codecpar; - AVDictionaryEntry *bandwidth = av_dict_get(st->metadata, BANDWIDTH, NULL, 0); + const AVDictionaryEntry *bandwidth = av_dict_get(st->metadata, BANDWIDTH, NULL, 0); const char *bandwidth_str; avio_printf(pb, ""); } else { - AVDictionaryEntry *irange = av_dict_get(st->metadata, INITIALIZATION_RANGE, NULL, 0); - AVDictionaryEntry *cues_start = av_dict_get(st->metadata, CUES_START, NULL, 0); - AVDictionaryEntry *cues_end = av_dict_get(st->metadata, CUES_END, NULL, 0); - AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); + const AVDictionaryEntry *irange = av_dict_get(st->metadata, INITIALIZATION_RANGE, NULL, 0); + const AVDictionaryEntry *cues_start = av_dict_get(st->metadata, CUES_START, NULL, 0); + const AVDictionaryEntry *cues_end = av_dict_get(st->metadata, CUES_END, NULL, 0); + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); if (!irange || !cues_start || !cues_end || !filename) return AVERROR(EINVAL); @@ -304,7 +304,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) AdaptationSet *as = &w->as[as_index]; const AVStream *st = s->streams[as->streams[0]]; AVCodecParameters *par = st->codecpar; - AVDictionaryEntry *lang; + const AVDictionaryEntry *lang; AVIOContext *pb = s->pb; int i; static const char boolean[2][6] = { "false", "true" }; @@ -344,7 +344,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) boolean[w->is_live || subsegment_alignment(s, as)]); for (i = 0; i < as->nb_streams; i++) { - AVDictionaryEntry *kf = av_dict_get(s->streams[as->streams[i]]->metadata, + const AVDictionaryEntry *kf = av_dict_get(s->streams[as->streams[i]]->metadata, CLUSTER_KEYFRAME, NULL, 0); if (!w->is_live && (!kf || !strncmp(kf->value, "0", 1))) subsegmentStartsWithSAP = 0; } @@ -352,7 +352,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) avio_printf(pb, ">\n"); if (w->is_live) { - AVDictionaryEntry *filename = + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); char *underscore_pos, *period_pos; int ret; @@ -380,7 +380,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) AVStream *st = s->streams[as->streams[i]]; int ret; if (w->is_live) { - AVDictionaryEntry *filename = + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); if (!filename) return AVERROR(EINVAL); diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index 9c67a6d3e8..e35c9909c0 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -670,7 +670,7 @@ static void write_table_entries_attrib(AVFormatContext *s) { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = 0; ff_standardize_creation_time(s); //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation @@ -698,7 +698,7 @@ static void write_table_redirector_legacy_attrib(AVFormatContext *s) { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = 0; int64_t pos = 0; //FIXME: translate special tags to binary representation From patchwork Mon Oct 18 21:32:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31151 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3750440ioa; Mon, 18 Oct 2021 14:32:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyECbiBNQukU1qqJ5MarFufNvFE/efKvN7+JuOq4IgPO07fb6WxJuxfeasVeaEx6AoIK5D3 X-Received: by 2002:a17:906:4fc7:: with SMTP id i7mr34967696ejw.14.1634592774746; Mon, 18 Oct 2021 14:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634592774; cv=none; d=google.com; s=arc-20160816; b=rMDHIgOL1DgM5IeV6NMHzjNPy/j84wTaGm5ksB8G+I4CB0FMYB49aO3wVtWLFlOo35 oPUQXRbqShNwPuuXV1AePMHc+eTiHaoIj7511lX3d6TxVYoNc6/GKkkswmyjFuS/6fUS XMfi2cSBB6Ap7Fes638gW5kIOc72EhAAgAgiQg61ffD4mDsOST6PNcGjgATMpZRoGlHa TXtfLg0cR+TjLjcj1QU0C8qBgoUAj4BH4ea8kRUjx3ivRYD6WFNUZIroKkfQgWyI7txl c71yCQHBjkR+VH/sfO/NVTUfN2bVoqOt/LNpGY8dIYeNaCYx9jaSbk5tOOgYB+EFzKX6 daGA== 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=lJVgbXg0KW+EWDZHtG8U7mkXetvEAaUJAXZTr71za8s=; b=mEY21k1yEEL2pRd2oJhduMITbrGytpB4F9osQqAS8Oq9+oS+gESY+4uTMux5HPPAYX SvJsR15lMtWqxkXGmdS4wgBJYDU4kN8uyuGbiKAJeyzWEVA8vUUH/JBOhPjLojibOHo4 Zl8c8UW1iC7/M0J0bTMtPcS5eDdFWYmyKAS+dSXfkRKs5GqcKfJooWl9c/8womWkdFe6 pYrGS4aKYIuBXifg1lnIITI4k1RKPyf5hZ57CwktYowsaHixBdkyXmKOwnmZBwrWdlts GYefQga19W7W8tzVs2Ot06tz/S7E7qXe3id1wdkDOZw4o6Uiqwm8WxtoVfZdhkpgPs9R tM0A== 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=T+7ArTlU; 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 o8si20343985edi.429.2021.10.18.14.32.54; Mon, 18 Oct 2021 14:32:54 -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=T+7ArTlU; 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 E8EBB68A77B; Tue, 19 Oct 2021 00:32:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9FC0868A10A for ; Tue, 19 Oct 2021 00:32:40 +0300 (EEST) Received: by mail-pj1-f44.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso407328pjb.4 for ; Mon, 18 Oct 2021 14:32:40 -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=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=T+7ArTlUfO1+d7ZxEI/Et4Xdg7jpaZrmXQwecIeaAKKspVh+u9ijapOqH5DN+vm2rP fyxElwFta/Sf1ZywODRosfsOiaLo1UF9vOLWv1S64BwboXbV36BjtNA8BolN+e21j8Wx 0cmrO8/Kn7Hdu7cav83HpJPRyR0RvqzHkJ8zqVy6ktao0SjHLGp/Mpc4RaFhGOQJITGc x+iAdIGUtXGPnVSGWHyPWiJ9arSFbJEeQoE/JyDMQZR7dz/z2gHNf7Loa+7THtYo/4d3 AvxhwVLmGNPraMF6zODcRd+uEESzDmbCR1dGL8bBHip8Etvg4fT+dyUgUfkEFJu3rPAD HgJg== 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=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=6/5CBvtGcxc8adndUuoitKrAZicEq4eLYJuCXuvAT2InJGPB1uRWDQTNwivjQBC2zc GsEFMdZnddC5m/j6ZOafWJJFWCsxLyPXqxHmUIuaaC3UQpOHkhUz4qFA8jLBZJFo9t/B P47zA1q+rNUapl/0uGGL6KChN3M8QiLaCLg4D5qPQh6+Tky3uzjy2XWLe3B9LZX17X7W fnj3Sk3H7etx+XRMezlqvwFh0aCprmMYU6aWtBMDkxqsQjwLkviutdSxfPLyEyMMLw4C IUH9uYKvAt7sVhxcnTwcuZSx6I01L4L8BLLx2dcwSDCn3DEl8TxYH4BUNycC1Uvx4zRB JwHw== X-Gm-Message-State: AOAM531q851UgLnX2JVkr8Gv2VB2WlyS95THwziJ4r6GZiEO6/5oaBOq yx77oO8erumRsD8KzbbG+3+qUGruJF6DwbWoTgI= X-Received: by 2002:a17:902:d4d1:b0:13f:af7:9068 with SMTP id o17-20020a170902d4d100b0013f0af79068mr29515844plg.20.1634592758834; Mon, 18 Oct 2021 14:32:38 -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 y8sm13892834pfe.217.2021.10.18.14.32.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 14:32:38 -0700 (PDT) Message-ID: Date: Mon, 18 Oct 2021 14:32:37 -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 6/6] libavutil/: 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: 3WN/MBq4tC/p Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavutil/hwcontext_qsv.c | 2 +- libavutil/hwcontext_vulkan.c | 6 +++--- libavutil/opt.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c18747f7eb..23023c005d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1451,7 +1451,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device, enum AVHWDeviceType child_device_type; AVHWDeviceContext *child_device; AVDictionary *child_device_opts; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; mfxIMPL impl; int ret; diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2c3216857a..259fa12cba 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -545,7 +545,7 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts, int optional_exts_num; uint32_t sup_ext_count; char *user_exts_str = NULL; - AVDictionaryEntry *user_exts; + const AVDictionaryEntry *user_exts; VkExtensionProperties *sup_ext; const VulkanOptExtension *optional_exts; @@ -671,7 +671,7 @@ static int create_instance(AVHWDeviceContext *ctx, AVDictionary *opts) VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; - AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); + const AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); const int debug_mode = debug_opt && strtol(debug_opt->value, NULL, 10); VkApplicationInfo application_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, @@ -1246,7 +1246,7 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, { int err = 0; VkResult ret; - AVDictionaryEntry *opt_d; + const AVDictionaryEntry *opt_d; VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; diff --git a/libavutil/opt.c b/libavutil/opt.c index c7001dbcd3..51b9157c2e 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1633,7 +1633,7 @@ void av_opt_free(void *obj) int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVDictionary *tmp = NULL; int ret; @@ -2005,8 +2005,8 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o) case AV_OPT_TYPE_DICT: { AVDictionary *dict1 = NULL; AVDictionary *dict2 = *(AVDictionary **)dst; - AVDictionaryEntry *en1 = NULL; - AVDictionaryEntry *en2 = NULL; + const AVDictionaryEntry *en1 = NULL; + const AVDictionaryEntry *en2 = NULL; ret = av_dict_parse_string(&dict1, o->default_val.str, "=", ":", 0); if (ret < 0) { av_dict_free(&dict1);