From patchwork Fri Oct 1 21:01: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: 30857 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2082360iob; Fri, 1 Oct 2021 14:02:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj2GDvLBLmjAqDcJ77ELa9btphgucybtOGhiEe5eEDvVnoxaJ1UwT5tr84hWH633DGA0QU X-Received: by 2002:a17:906:9392:: with SMTP id l18mr119441ejx.52.1633122132527; Fri, 01 Oct 2021 14:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122132; cv=none; d=google.com; s=arc-20160816; b=hXjm1NIHQq0ohmzsdpp3vFouSqGtuT84aioWq4QFg0lh2DfnkJNFuai/W0suorONFT EZWlQEuUWquGlRAgh1nfCAsFXPek4oYtV+FK4/nDPFAHwgOgntj/IVyNxNwarsiycHSg wkJljd1LTOBx8+1F+exKa766bISFnNxunYO3tnjsZd/a261yUtX2t1l2n2Qjt20BjTfy hT5KLY+gEOs2D7DlO3P6C3JFq8WEawatUQ/z8nhXzizyOmiOyLTR4n2aVZpL5Zg5+NER OxaBuVZNRFpvBhL3kX6T9SzE91MJHiiL86AlkCJzQH9Ckkbiq1pTfyhmLNNTn5nXiZDx NOhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=VUAA3YRTxyv6I4EyFsI+M4f+vu+wMJq34jUa6b5lLbY=; b=TWbf6yGAvJnVskrJzW0cwi8esh253xp2F3+qw5KYgcATjyQv4ncakRm58GigOvwC5y TkB5OD9GW6HmDdkMkJFq9hsYzjlhkzh+WfDiFtQ5X+M3yviG+NzrPhiWpZ/pfQKc4ule R4kVheiZb8czfEiEZ+KjtaXgx8aoUGFHj2YHoLvSIQxPrJM7CraBVdHJC4UZyXA5HGoC m/Wyf4/MeV3ZMuEUlS4r1wkaaMKGPKKkxnALRbywAQYOHyupxQSBkv5dLt7qnQMNwc/o bNBWpfKcfyKX2gOS+nvinwYzYeEltTIJJ/1mPTE23CyMu2TZnPw+6CvX+xFvT00CeUW/ XyJw== 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=5QUeWi3U; 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 k12si1789752edl.625.2021.10.01.14.02.11; Fri, 01 Oct 2021 14:02:12 -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=5QUeWi3U; 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 D9BFA689F8C; Sat, 2 Oct 2021 00:02:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 36D64689F8C for ; Sat, 2 Oct 2021 00:02:00 +0300 (EEST) Received: by mail-pg1-f175.google.com with SMTP id 66so10086793pgc.9 for ; Fri, 01 Oct 2021 14:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=qHC+KKrDbsM025kXJoC95yVep5Nh0x2DkCJkahu2nCI=; b=5QUeWi3UgZ72IQfHM2WkDPe1qwf4cqm6U0CjZ1IiFMS06onsiclbOSQtsBsnrEGlhQ f5BnC1vxYTKI9qZX2a5u1igF02oitlYZbTUp7vukKMjPR+IJ+sJnoEwDwrc8gv7/ojQ1 D0ZeoqxsOFQVYGJwA6wDQkYAnvIKKGyQt8WHRJrUT+McLy6ZkAg94eWpY+ZFUM56tmaC Vv+YsDHe6DrSIUn/46Xd3PXxskB0z7JjObGbt02ccftffF46tPBUOctdNQfXuNNyCdkV eEFVYKHQtTM0LZlGYc4fUph8F3ESPa8UwM2UGOUcFm/G69zyckYKumqdKVkagLrWyqwT qrHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=qHC+KKrDbsM025kXJoC95yVep5Nh0x2DkCJkahu2nCI=; b=JnIVS7dIHdbH2diWn4Kfg5HDaYKkmqYUOmtk41jMYt/wW8499hDDKjBf1vlm/lB7z8 pw7GRR07X6IjqJgTtjkhWEDlw4moyOVAF7kB5w+wTh4vgkq7zBjtSVOXcswK0Mg+OWFS fBxTBFSB/GHuLo0P091QT/yDnNI9qj1l0mL6mNhGbERSScM9ZDvqG5ELkwASS+FbqThY BfVI+nmZdByJy7J9vpmGwib6zAalTeqGy6ndfw90x05/8/M7LsDT8O2v4OiZApiy64SH C5lmrMzuWA+JVsoL+ArlQa2p7wqv9IYBz8w3j40NZiiYy7YjaFvwPtqhoeu6WSTuCabK w25g== X-Gm-Message-State: AOAM530mX2OysogyanHYOiqtipLpWsJ/Tm5ScldY8c0J4OkQo77UlTQn A1u6P9wB5XJz5ZIwjfLSqAluMqeeg8zCBEhzF30= X-Received: by 2002:a62:5803:0:b0:447:d62d:161a with SMTP id m3-20020a625803000000b00447d62d161amr13270738pfb.85.1633122117424; Fri, 01 Oct 2021 14:01:57 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id y2sm6387482pjl.6.2021.10.01.14.01.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:01:57 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <3374ec54-e39f-35f1-ac4c-13e26d4f09a6@triularity.org> Date: Fri, 1 Oct 2021 14:01:56 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 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: BufbAyQK498C 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) { -- 2.25.1 From patchwork Fri Oct 1 21:02:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30856 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2082768iob; Fri, 1 Oct 2021 14:02:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycyLsFWTDjNQiXuuM66YHCqX6IYFefo8OK2LCAuPln+GU84VQ9m1ifusjQE/sgPon+dZ7r X-Received: by 2002:a17:907:75c1:: with SMTP id jl1mr100455ejc.288.1633122159125; Fri, 01 Oct 2021 14:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122159; cv=none; d=google.com; s=arc-20160816; b=Ae2v+BoOr56fcBMGk8bQNJGgs1h+Mx3TjCK3NxBwEtmf4hrWdr02HjRxS6Tj6QQWaQ omKVIiv9nqdn2LsmN3HWfirf2LD5WzFHuF6bHdM1tcpK7wTjDPsN6oRU2gr50q3MFiVr pZaXwJt9d7GCbb8vFOceprZNlqiJKj0n6k6pGm5uLPCqGuhGql/wB28mZkf9aEcj0CFi kHmv6T1Fka0HxBTpjwlVbmkthNfg4Uz9if/TFafV7vlvruDGXebNWxlXvwsGDvUrE+PS YXejzDJijzK783L8Q7TXZpdmNi/hHjtSaJCu+WyfrNyYHb9pB4KqzzgKd1ZYt9WcFzhF +Jng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=rhsKcdsxSaenx2SEdheX9NWSx+/6fJaxzT5tWvm9icU=; b=vWdG4+4GtneS9nl4QRdmtEFRJM9WqwZsQf1TWuON+KE28V8ncoEzAdfXBYXRUwITNC xFrQhJbatOJRX2I5BB/1XTvUQXs1GS2PrQDvH6/8TTJDxxHcYes3Sea/wPCe4RwlDwog JrFZz8yG326igq7QeJG08gXWcPIGbB25bSWAWoXp3Jt/CDngdxlzEIkbtDfh9TS1XicK cTPvtInacGPcqwJ3T932PKpoZ/xI5PJ0j0AQjEcq0LR7s/81aZcUIVf8Q1Hh9E0OVmjH KycsgebhCZVD6TJ9Sv3wLWJ3E4m5AluNot0k6Ujs67qpi9X95f9qjEjXm+VcaDQcoJ5P FTlw== 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=qpLKVY6L; 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 c3si8735810ejc.450.2021.10.01.14.02.38; Fri, 01 Oct 2021 14:02:39 -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=qpLKVY6L; 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 228F168A703; Sat, 2 Oct 2021 00:02:36 +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 7EA2E68A755 for ; Sat, 2 Oct 2021 00:02:29 +0300 (EEST) Received: by mail-pj1-f54.google.com with SMTP id r7so7359825pjo.3 for ; Fri, 01 Oct 2021 14:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=MassmeE2WdVa0Lxcx4swmu7o6R/RSHRG0/4NpsTwhgY=; b=qpLKVY6LHB2Eq3t04il6yvixv70Z1FZjy/XSvG+LMIZ84oIFP3qI4LrsL+xgxxEpL9 p5Megf4P2CEeWTt/FObmFYK0RQX+zZig8Ns7mFSIwGkIiKfO39UBJyUMaeeJkvLm4gQV CM+z7kyxbUmsjB64X0jxH1v3p1aIwuC7COAmN9eVo1EqZmnQTTaAzYWBEty2QtEZO70a XhkswECIMJLUyFdpTvY+D7HiOCO5NqXDO/EDpfskIvX4bYjR5Ea++O24wtXXt+Bq2JKY JMAkXhWqAxbphe7x4e9MG9Ww4+bZfgvecBbi43DDoZt+Vi5EiBC6oby79wdRIG+62t96 suSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=MassmeE2WdVa0Lxcx4swmu7o6R/RSHRG0/4NpsTwhgY=; b=Rtbw9dWlijtWxXCqDVUewwG4h1xWXiQoNq4EiQD0eEqNzcfsBYRYVxsDi/DdeQ4kPE cnkFBgEzTlRXfW3MdsXwglOl6q7klRN04dRvpOcTiAzA3L/wBLfxqgBT4cnKfh94Y/FV mPKRX9Kjgvr5M6plG/yu8DQ2yCLU5zgpbCAIfh8hKAWuh9hPWSclcdM6K3hE+vLTkeWM e2aDubJ+HtcJik2keP6j0bs9jGGuMITpDDHS8D0W49JCzohI15Efpj9tI8xyvTAlqb1R 83Nkwo31I+eKSbRv2EGD9olXs4xN7DQ1fKtqfSBomLz43QAKcLp4QheOezojXfHQFuBN +Y5Q== X-Gm-Message-State: AOAM530UnFvCn9Zv7kfuBiwdtiUMhSOapioh3SQ/J7ZaqSGe7RDcK73A dRQ8QoFJdGVOBcwja8H3y4JoiRoZia0eNp6Jpio= X-Received: by 2002:a17:90b:1c8f:: with SMTP id oo15mr22399048pjb.87.1633122147336; Fri, 01 Oct 2021 14:02:27 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id i9sm3750972pfd.32.2021.10.01.14.02.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:02:26 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <4480fb15-e98d-fc39-3541-66e9ac464295@triularity.org> Date: Fri, 1 Oct 2021 14:02:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 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: jao+Ut6BFYQ2 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(-) '%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(); 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 From patchwork Fri Oct 1 21:02:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30859 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083097iob; Fri, 1 Oct 2021 14:03:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjoj/8gHk1gb+7DJWHPtWuFTR2X2pOpk+B//YMb58k6PN/vCGt58vIiThI/nBs4mV6Q66P X-Received: by 2002:a17:906:1856:: with SMTP id w22mr48846eje.393.1633122179866; Fri, 01 Oct 2021 14:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122179; cv=none; d=google.com; s=arc-20160816; b=PNUq2jD76xw2w5fh2XQmgexwwmd84hOemnPfzv2mpHONKUs9BloIe3gKIJE6j5D1Tw nYTTdjwVJGdJIa++Z701UUAydLPVHIHUkSSDto9ex4ZqxpIAVYe7zBIzhulma7NTbksj rjztkGPIhuxYiWSsHCZSU8gbleXS4T/Kt6YagBGtTXMA3N/RmVjTKOGxjxIVBvAUrP3j af0A6Fhfau39KQMXxRno1qetYlcxNwW/N+qnrZFMJhf10JDjy47ySf20oymkw0LEfsGX 9bndyZWvaAXfancMLl72t0EoLvTWqX+skI3PMh5q3nzU9aqRQvV2QtUjDag1g48GSYtR DyTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=F1zxXTK92DJcOQN0zx9pM8/Eif/g5kjXAIEVu/G0YMk=; b=x2zDAl5GD7Y6ZdR6vYpVX35Ydj/fWlKPGnbnpQQrvMIt35Dk1lW6NJbwvoTsiUFUy2 f+3STru0JCpvJ0rlwaCzcj19vQFeY3fDUdIlLy8xFSSZ2S5mpbaCdv2RtkqC7GuUdNIS nEku6EnrNFcqQpnz6zlgOFSr1H8rtweFMu8wIipRO4tcdVOp13ttohvndGN3cnQ9mTUC xwjY8LgDwXpKtR5cdDII82m8Crfsk7knSjNeJHjrpnU6XtOmL1wCDQtIXK07EZRCAIzM ymA5iAZGoN7GdKvwoqioopnL1i9V94FOxONZZncdz7dpQ4EwYPnUDJAlwEgslsOet2D7 yh5Q== 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=y75n3DRj; 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 g23si8545939ejk.552.2021.10.01.14.02.59; Fri, 01 Oct 2021 14:02:59 -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=y75n3DRj; 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 548A768A78A; Sat, 2 Oct 2021 00:02:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 197C068A784 for ; Sat, 2 Oct 2021 00:02:38 +0300 (EEST) Received: by mail-pl1-f173.google.com with SMTP id y5so7094746pll.3 for ; Fri, 01 Oct 2021 14:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=loxR5SLTP9djcYVExd4dad6JV8u/gCgEVcalDGyFr04=; b=y75n3DRjut6xCDFkOujGaQRIgM7Sa6y26VuQmTZu21kkyCT+uhFvL7lljZUYHhlCe/ ZjCiKcANpXz7f9HvKriGyBl32tPCXPf5Ob88RyoYFEM6OmEzprbwop0c/QypXaA6scCl HqzLbWGZMjl2pqSnei5vilfWYefFRBKr9mNJIia78TFJfQXZjKCGyOPVUjKowf2Etr9T OgMRki13V5g+5kdESzFiG3zYzzLeNm7vQGZ8tMFoVJRXI8JofrYHNwPTEcMYcmEKssl/ SU4sHxJQS9o9R646nPqlxePpZ+s8AfYyuM2QK2Ve6cLlLILkcbHZH8MdM3wF02UhWn7U laYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=loxR5SLTP9djcYVExd4dad6JV8u/gCgEVcalDGyFr04=; b=sX/JzQccFVWtgrmXilVsPre9yCH1boMMGQTvB61QBJLGdlBCvG0AzvcBG2YIIdxoQC ihEKfOzdmUsKK3DoSh8y7stbULfxs6KnEvrzNP0erQmVaSNc46NJ9D8d9jv8h23nT8eF pDod46DQ+AMz1PcvWlyBPXcxjCWRK+i1kxxlIxC+CJdhJpYYlCgKspGgNuTyHCzT6f/k 1E10wk/iGOFevHsoS9wbLgsHq+F3QqSNVIXkGODM3idNf0iRSGIWEW/j8YZxvzOGGeOl YrULE0S9i1a0N13pK71cHe6IvnH4U4qTgWp61OOqVaeCUKmSdGu3YAM2PxVukWhwh4ag 3kKg== X-Gm-Message-State: AOAM532tBKi3UdeWxpX1/CcuBlPZUKBpGwt/xQi7H6mAejtXU5gMVicv W8MrQu22dZqH4yxsiu0qm0iamoLfCQuj4DuXvss= X-Received: by 2002:a17:90a:154b:: with SMTP id y11mr22326821pja.116.1633122156584; Fri, 01 Oct 2021 14:02:36 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id q13sm8047697pfk.128.2021.10.01.14.02.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:02:36 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <024400cf-0a7b-b3a2-d5fb-428c1e7a3689@triularity.org> Date: Fri, 1 Oct 2021 14:02:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 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: 5JY6c/wymr6v 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; -- 2.25.1 From patchwork Fri Oct 1 21:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30862 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083248iob; Fri, 1 Oct 2021 14:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYTPc+kj1fr+ihmkWvMhjiG1HPT/ulOcN1f0e7T62oK8u34mzf18V2GAWvLpFWU2yQzX4i X-Received: by 2002:a50:da85:: with SMTP id q5mr266745edj.300.1633122189932; Fri, 01 Oct 2021 14:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122189; cv=none; d=google.com; s=arc-20160816; b=CVZpfTyKArdE7KHiICNVccBHWKP+x3pr2sTGCvo3z3yR3jVUAw0s6L4e6IHWJSoTZU LQ7AAw51+MJKnvrDBZx6p4YmbYlF8K5pxOdd01j24EFetLXqlmC/Gj7/PzCyfrJdu3Rd D6ih2gWxbNtKZBf4Nfam2w94U9rMF5ebQ6jX3viGqaNcMTLXfHblU74iqs0MuGAHE96t kbC4TAZD4auHERc0PAXwnznUAztUEnR8yRKB+guWg1QPZ8vWFKHKU9/2si4MI/e+dG5C RBhqkX6UhnheRpmQgul18zWayNxLqlPwqIDim1sZZL89OsW9T2qwyWoiX6rbkdrOVh3Q mlpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=YB6sX+5N+P1BQK11jBqUcvhuBZRb/fmE0Q5cv5W+1NQ=; b=FCTDhpfJBXAm59ZwlHsyoKUk1yKDcR34e3E58WCrUZRAPk5g5jYgJCtwKCY/98ug4U XW/zai9e6NFQPvaVqyOOatp8FSNu1EsIRTdLGvXP/graYQmhTYPJJT7f9XkeaoN1qwLz pBEDxdFjqGBFg+EQv7g5OsGCAG0w47z4EfO78TpwGx4GxL5ccvQ5ckpProiw87hk3Lze 1X/PLuEqQ2JcV6k/UvM4ZNF9Wa5WBLIs7i6+a1tftHRX15tYWRyR5jiANsjuHs3IWp78 +jkLBL0BivYnFerhPAQMzj7iP4nScD/HuIeCi8t/2zjSlJV+2hJRUMeKWG/GbQwAIkzV ViKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=w+X1h5l+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g26si8381347edr.225.2021.10.01.14.03.09; Fri, 01 Oct 2021 14:03:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=w+X1h5l+; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 57F6C68A825; Sat, 2 Oct 2021 00:02:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43C4868A7A1 for ; Sat, 2 Oct 2021 00:02:50 +0300 (EEST) Received: by mail-pg1-f169.google.com with SMTP id a73so7572972pge.0 for ; Fri, 01 Oct 2021 14:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=zHuRv/oBXkzoLkaeccCCCMXR2ECMfEDnljT+fo113No=; b=w+X1h5l+VWo5nntZqDmKmzFYbk9rSiWLUHu6YAw6sbbH0HUP+TA+aGsjjup7uizKbe 2WvOj2N7M9dZ8dFDjLDVV8Tyu3peRam1u4dMNdFqza2jIrWKFehBP5erGsCd/J4Z01lt q5EDczeWu839twX5CBvbQ1bLckKsjg54c7OoQiitP+yIntK5uYsqowytggzKPJn4noik HennzBIsTuPysuscZkvuoKt2WggcesKlkpXKJyMyRS+ViVQhBIe9fQAbMQyK4LxISIYb JLkiAXlSHgFN853vdMbzk5pOOlrjE/ukL0ptZxKnrxasCxUl9idd6+uaUd6mbKnNZ5Nc 8yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=zHuRv/oBXkzoLkaeccCCCMXR2ECMfEDnljT+fo113No=; b=aC2gtMPQl1OrhsdQwfNzLgdB130YgQap8Qj/7QDpf6Wf15yV+b9E8DoQO38nmiICIa DtJ713fhrsxdfOt+vbX0jxkc8NXbVYDzK/N8/BzM43eMXfjQvq+JX1BYD+dFnrQLkjVV XHJJfdFQhVLc3ndFPnumw32LdaKqMpqT+aC1NYK+MUym+UwfI+FnDf7VXNqJ5A1XcBsx JvI1uOO/U25gY0DDEbhZOX5PVf/lSeUrRSLgfjtRS002FPjXwdBOXfO0fVcPx+ZDI1g9 pUihg5RIHBEAIZO3XETGDX5CWZ4iorM/37Gf9Dgn+nY1JUIm7f/uYjLiPigatJaEx+cS ucRA== X-Gm-Message-State: AOAM533pWSUkHkoJjNgy4eN/bf/H8ysYmFqqgqX2TLD1W0kupxEkqw7R TyF6lMwQ8XJbXJOtNQOKOAdjp6fhNCuKWxRxjSM= X-Received: by 2002:a63:4b4c:: with SMTP id k12mr148669pgl.172.1633122168165; Fri, 01 Oct 2021 14:02:48 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id w5sm6755261pgp.79.2021.10.01.14.02.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:02:47 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <816fdcbe-439f-9524-6c88-2df255b1a262@triularity.org> Date: Fri, 1 Oct 2021 14:02:46 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 4/6] libavfilter/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Vb8FZxPp+ygz Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavfilter/avfilter.c | 2 +- libavfilter/f_bench.c | 2 +- libavfilter/f_drawgraph.c | 2 +- libavfilter/f_metadata.c | 2 +- libavfilter/f_select.c | 4 ++-- libavfilter/vf_cover_rect.c | 2 +- libavfilter/vf_drawtext.c | 2 +- libavfilter/vf_scale.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index f325918021..c0573d53c9 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -939,7 +939,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) int avfilter_init_str(AVFilterContext *filter, const char *args) { AVDictionary *options = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; int ret = 0; if (args && *args) { diff --git a/libavfilter/f_bench.c b/libavfilter/f_bench.c index f7098adaf4..16ca17723b 100644 --- a/libavfilter/f_bench.c +++ b/libavfilter/f_bench.c @@ -69,7 +69,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->action == ACTION_START) { av_dict_set_int(&in->metadata, START_TIME_KEY, t, 0); } else if (s->action == ACTION_STOP) { - AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); + const AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); if (e) { const int64_t start = strtoll(e->value, NULL, 0); const int64_t diff = t - start; diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index 9996eb3b0e..7cc1efb3d7 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -163,7 +163,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) DrawGraphContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVDictionary *metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; int64_t in_pts, out_pts; diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c index cecfe62a9c..ee87a2b37f 100644 --- a/libavfilter/f_metadata.c +++ b/libavfilter/f_metadata.c @@ -306,7 +306,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterLink *outlink = ctx->outputs[0]; MetadataContext *s = ctx->priv; AVDictionary **metadata = &frame->metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL, !s->key ? AV_DICT_IGNORE_SUFFIX: 0); diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 187e98a1a7..ab26676e57 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -304,8 +304,8 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) static double get_concatdec_select(AVFrame *frame, int64_t pts) { AVDictionary *metadata = frame->metadata; - AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); - AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); + const AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); + const AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); if (start_time_entry) { int64_t start_time = strtoll(start_time_entry->value, NULL, 10); if (pts >= start_time) { diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c index 0a8c10e06d..d3a9755234 100644 --- a/libavfilter/vf_cover_rect.c +++ b/libavfilter/vf_cover_rect.c @@ -135,7 +135,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; CoverContext *cover = ctx->priv; - AVDictionaryEntry *ex, *ey, *ew, *eh; + const AVDictionaryEntry *ex, *ey, *ew, *eh; int x = -1, y = -1, w = -1, h = -1; char *xendptr = NULL, *yendptr = NULL, *wendptr = NULL, *hendptr = NULL; diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index b1ea58f30a..197163f426 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1032,7 +1032,7 @@ static int func_metadata(AVFilterContext *ctx, AVBPrint *bp, char *fct, unsigned argc, char **argv, int tag) { DrawTextContext *s = ctx->priv; - AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); + const AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); if (e && e->value) av_bprintf(bp, "%s", e->value); diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index a1902a13cf..698fbc4768 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -551,7 +551,7 @@ static int config_props(AVFilterLink *outlink) scale->out_range == AVCOL_RANGE_JPEG, 0); if (scale->opts) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; while ((e = av_dict_get(scale->opts, "", e, AV_DICT_IGNORE_SUFFIX))) { if ((ret = av_opt_set(s, e->key, e->value, 0)) < 0) return ret; From patchwork Fri Oct 1 21:03:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30858 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083438iob; Fri, 1 Oct 2021 14:03:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVzGtCjfuKptzZGX2xB7bi0xkQOjlthK2MScD54ANA6A8C1a2JyDE3gMTGxRt6oPou+Vt8 X-Received: by 2002:a17:907:7752:: with SMTP id kx18mr104283ejc.276.1633122202817; Fri, 01 Oct 2021 14:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122202; cv=none; d=google.com; s=arc-20160816; b=V+5g8lgkGYyxnYzW8EbEGtC3LX1ODIPLXqMsEiUKlJlrxe+LXwRMV3uynb500Jmu/Z 2E6F/YpG9Wp71GcOtoSnWq0MTQcr3RZKOhOHJa5MN1V1cJ+/+xm7zXIreAJ5heLqTOyc 1V1Sg+HgRPVm8myH8ahaGyGzT1ftF4T+rXh5iOkEEgFRvgLXugawQQLP15C70qk9xSjY kANVOQc0l8dm2rx1hEk7fxmKCe4MbyUm0TSgV6k8Z2RJV2XM3rxsWAyKG8kriu1hwJ20 NlKVQKky4BIvvuLJNNS0ierq9ciohEZVIQ5/kyoi4+Hmjm/FMIRUgYQ2atlVoyqixGjq cNdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=lP/tACfUm4Km/YFHQkSoLZZdm0NJ29qhtFnofU3tEDI=; b=dBxbbtnynYKztH9cybLq7+9PnGL0k0I3z7UdyAEadSmt+qEJ5UyNDfIbK+xPgfhOb7 eModykvRtWGki0IQRNeBsAP8ZHfAGW11taAfaZbPjrKgRDRNMOlSt7c3fqXCTwOJ/+Ai WtvlBYa2XbU5jfe58MyUMRMd0nf1M9xWX6TbrJXmFV7OYRUWyI3WVXRovfTVl8t8eMms rqsjUsWKiUw00eXWqTSxzDIjbaQ014Cvbck62DsQMPCy23SRk3O9kvwYB0glb/i5kc9g ryzdbd2+UdTjB/Ncq0CKnhnV+mr3rfPZ2Mt87iV4ZpCM5zFxrfkvlroMXihc9vqB5fgh n3nA== 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=ECwIUAir; 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 k9si5461495edv.52.2021.10.01.14.03.22; Fri, 01 Oct 2021 14:03:22 -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=ECwIUAir; 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 6E3D468A858; Sat, 2 Oct 2021 00:03:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2ACA368A831 for ; Sat, 2 Oct 2021 00:03:10 +0300 (EEST) Received: by mail-pl1-f174.google.com with SMTP id j15so7081506plh.7 for ; Fri, 01 Oct 2021 14:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=nMmcj/XVsmYNmh1KYNWd7zW+DAqZ9BuuekbAQBuL8Q8=; b=ECwIUAirVSiAoU+ERnVaO6+5mhGgyIlG654Ce8qmx3OdSg/+AO2Oap0qVdoMAJU+aL P9JwwMRxSgq0odrTWN76iwGHLz9AwJS/W8JZ/hStJEt1jjtA0jrbxFOGlk8pnJ7tTiQl GFgCucpcEDci5uMSeJZ/e3TFhFVi/XWCQ5pI7saVAj6G2Ezec/gqMw4qAMsmFPRbHWnP X3qQraUdkZKye34HEs+l/BqBudVOrHd0jm3QOkap633PiQ4kirlhLC/9jorIj0jJM/up u9bLNA8I3U953tgSiS15AqyZSAHRydvhhkJpSLBrn/zK0NaExveWk/DG856NZH2s6pEW Po3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=nMmcj/XVsmYNmh1KYNWd7zW+DAqZ9BuuekbAQBuL8Q8=; b=pdhUSVe4gzBJQoYzrdk8w9C6jYJfWwbbzJ8sFGTI8VrafiAZ1znDLuV1u1aCSQ5jKY NlzwohKVU+UN3lHUTeaxO+5D+ACJWPnRAXAjdU9ex4EGIpXIi8xYwFOt734RLYSjE3PV miRyJ9HUWnlD2wo3ubZbDHMmYuCyuhSHE8xfqqyrqHOq/V3gAP+8jWA/wejOc47iOY1S ZPHzMJF8srUMqi3S8dgk2VYI6sVAZV+yc5zPGKJ4iFKDwCyMkyRdSKzRTpCvPPv0y0/g 4CHZsNV+2jR1/0a0ghO+UWfSLai7VgX84ncMY5S3dqmc8x5rhZhXyo88wNeJt5X8u1Kf 0rZw== X-Gm-Message-State: AOAM531D+OZlSffR5S53XFKAEdxxgMNYfNOa9iZrmdHtU6IMMS4Mu7JV G4PaCKzsefxDDGSxBxdLEubI5aNuGmumP4UZzA4= X-Received: by 2002:a17:902:bcc6:b0:12d:bd30:bc4d with SMTP id o6-20020a170902bcc600b0012dbd30bc4dmr12580594pls.18.1633122188017; Fri, 01 Oct 2021 14:03:08 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id x15sm6843029pgt.34.2021.10.01.14.03.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:03:07 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <870e96d4-e205-8f9d-679e-7b8d969936db@triularity.org> Date: Fri, 1 Oct 2021 14:03:06 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 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: gRaW/L6EJhfq 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(-) 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 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 From patchwork Fri Oct 1 21:03:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 30861 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp2083616iob; Fri, 1 Oct 2021 14:03:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSDM5v12aTa3AEzrYIJ7QM2Prwnr7pUi44P3rEfgmomh3Nt6sf1M1vEVUNFOm085nUcz9b X-Received: by 2002:a05:6402:5193:: with SMTP id q19mr219664edd.397.1633122214717; Fri, 01 Oct 2021 14:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633122214; cv=none; d=google.com; s=arc-20160816; b=kUsJ3ZJUpKV1CZKtrAdujwdikuP6M7eYeV2gHTtCyn5mJIVCLhC/ALor/xHRjHjIrH 75D3GLMns+4DVnlB7bw5JKo7PF6lJq3OlnzDc6QgjHvQFviUhicjxowZVPFapKZohNz2 6J6otrui+Z4VDTOiPM5w+XztJq+2V0XmCX+UOac9i95+uIZvcTWRZ2P3I+TxN2r+48C/ 8O+CNTHDY/yDIGk8q+s66sZicKd2CvnnmAek1+5XwabY5Qsp2T1DJhmiG2GPJWAV5YU/ +y2s6C1kndvwEtEjsfjZvDfrshYOmRBf06c8U6t3EmSBJHXQrrQ6ZM72POFw+y0itEl1 MIiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:mime-version:user-agent:date :message-id:to:from:dkim-signature:delivered-to; bh=rnx3UZSRMuwCGKyccoMb3E6s6OyCCACfrQcwZFjTOXc=; b=lDiXBd/YXBc6mhSLUUew7CX2aEHdP6M/XCCQasVtA55GBKWBD8X03QguIV1DIK5lhf aBhBK+s1Lgs7L+8iqtPO9cek6k2KeuiYXiCmaWTq2UjJwd11iyurKLB1ZEjZyZHxbOTw DamIj/AT/4EJsIFoVWH8bHh6l6Q+b/y20mzz8n3NqiwoGL1xJN004Twp2gUZwXes+ISu OLUIJU6Vxurd69KBFCepelj5dqhnqyq3k8Q/g4xBxVbFPiQFFj9EZlISGQzxWAOUobae eSHAdZa54C8CrKw521oQsxLHMEzsxssdOLPKPbx+nQ7zwLS2kLHJ1y/E9pbMAyUq8+BM uGaw== 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=n1dCqcYq; 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 e2si11954794ejs.346.2021.10.01.14.03.34; Fri, 01 Oct 2021 14:03:34 -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=n1dCqcYq; 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 7025168A878; Sat, 2 Oct 2021 00:03:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4BA9C68A867 for ; Sat, 2 Oct 2021 00:03:18 +0300 (EEST) Received: by mail-pj1-f49.google.com with SMTP id oj15-20020a17090b4d8f00b0019f8860d6e2so1087003pjb.5 for ; Fri, 01 Oct 2021 14:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=from:subject:to:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=6Vx+Ya9EXdy4rIrkiIu8508VGURH82WFqGk1qzmK5Qs=; b=n1dCqcYqfCxL7SL7FXZR1KhQt/ecqb8hi9iSA3uTqXqR1b1Qcr/Ra6hmE2UAEFTbUY JDMX5he9W7LaKlYFOuFYTUxC8xq9VVqW0Lzb02jFDDHU9SSHETrMg2Nmb+3RPFFqx6mn bHvLiA2F2M2lahHqXNANGI9tuwSTZT9AuRb/Xg2qiZFjw0si4wkIknN2cJeTA+WbK8uT Ojng8lW2k/NlWQ7ZjctN/psJHUYROVYbi0rEaaM1CYxOfDF+u3KWI0h9mq7nPmKQTWqP ddZsqofuSLMu3o7/WC9oGz2y6WJ+WoAsEvdPYgUTnYICC6WJh+ngcU0qTS8EyyqePmrV kTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=6Vx+Ya9EXdy4rIrkiIu8508VGURH82WFqGk1qzmK5Qs=; b=SwRxyI1l7/kkPYr1sNzdlff/1+ySH1FRkxzIN4xugwm630xCMgtwZ4Tq4Asrf2w3PX S5rnFFRyHzMlTp4FUy2QeHDOeCWglsqz6oSRenwLD6l9A8TtZs6wbSH3MtE0VcVRDUc+ 2oOzqgd7xA8yziGWDFVMmLl00E8ECc1QoAPwiEhDO9gqsu/DZ5Xir1zKRoSLy1EylFTL ZKqaagXZSfck79Sp4+FdZfdMUAXkJt3q1q0k1WY4qg3ultNV/LJjbB0qAjL7pOMOWf5M okBoiw1Saktjqta3Xf8c5/+dq/kz6a3D0feDGvTm/3xbxjF4eDhYDg0XWZ6prh2N7hU6 4Atg== X-Gm-Message-State: AOAM533vcNg2qOWisKCrTuLNSH80MWko1xLsB17xkd4Pu9WiVn9mS4sw GgmsyMnTJ9u4VScQdxJmlPeoh0N/tDa1P1tY5Ys= X-Received: by 2002:a17:90a:a88b:: with SMTP id h11mr15478719pjq.44.1633122195849; Fri, 01 Oct 2021 14:03:15 -0700 (PDT) Received: from ?IPv6:2601:603:5000:f89:b9a9:bf59:fefc:daec? ([2601:603:5000:f89:b9a9:bf59:fefc:daec]) by smtp.gmail.com with ESMTPSA id f25sm7221933pge.7.2021.10.01.14.03.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Oct 2021 14:03:15 -0700 (PDT) From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Message-ID: <312ae7d1-dca9-46da-72d6-69d8920c25f8@triularity.org> Date: Fri, 1 Oct 2021 14:03:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 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: mo8selGrkpvT 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(-) 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); 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)