From patchwork Mon Oct 18 22:27:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31153 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3791472ioa; Mon, 18 Oct 2021 15:27:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfKuaB3nChAQTOgODbi33k3JSGBB8HER2/4IOLyg6g2BHyP1WNrT9Dqfr4wzi54XVwQoz8 X-Received: by 2002:a05:6402:354a:: with SMTP id f10mr47506098edd.365.1634596044892; Mon, 18 Oct 2021 15:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596044; cv=none; d=google.com; s=arc-20160816; b=SiFc6cfct+aZuGeM0mUCgCQsK1gn/0LHRib06sHxgOFp0OmjrCc/2liv4HWDtWg57D iw8uTegUaWBp5dW7+uu0oVAH4G5yuURafwfGKm5LqzRBTsVjfGDw5oTVgZ3NK6RStjWa sZ9ihFMeSFx6CRjx0tUuU+YIVRbkRh5kWgEkbAuLh4RH+/bje5fzP7sLrCjsQSKSRiX7 B6OnZCEAmYcyYSlninZMRm76u01etjXT85IiHcPdWSvqEit7Je7lpc9yCaaRxCh4Nk6N hmYyqYxpnOiEkRfj3qf9BHlXNaJbXHVsyTf0bDEh8ghvLE+X25jpTJIwBQai31AI+xDs LNtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=SsLCqem3d1ad+uC7gamOf8+5dyGhC9VsDOGa6Y/ToUc=; b=kicEmWAUaHjzQr3LZPTS0RSEmsFczzoxoAhh9fEkQrcpxoyJBAOBOim+jPypd/vwrK Zg8gJrYpXutsu4nWN0OGyCQN0z1Q+RkniYvpcpfnSWuC1THjhQMZPfQG4dPR2l/7Tayw JKMOuyQVhqOe2SxLEoaidXSdcAExE1y3ORMq/wRFR8JeE612mlxdMaF1I7/0I63d7Pxf uUKvXloAbSnYERCI2D0nBSRp4e+8cyuPywpENtxWAMTGDejAVTv8eiRn5BUNgbGtolT1 jVmrG+UtCsCwT1QGLRI+6AvE5U4qZEKXGwojaClNRByY48pOyYZVTnBS88619u55qEtg TVow== 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="DHSwi/AA"; 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 gc4si20507772ejc.410.2021.10.18.15.27.23; Mon, 18 Oct 2021 15:27:24 -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="DHSwi/AA"; 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 4FEBD68A64A; Tue, 19 Oct 2021 01:27:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E358768A4CA for ; Tue, 19 Oct 2021 01:27:05 +0300 (EEST) Received: by mail-pj1-f48.google.com with SMTP id oa4so13225913pjb.2 for ; Mon, 18 Oct 2021 15:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=qlRWM/8qBxzL8xW8f2dB/NRQ6Ceza05Qtz1qnu4KGyU=; b=DHSwi/AAsKjipf17nCoif86Pn25/4W2zDekF5MaDI4eQQsiZk51Tn0qvnIPDK2K5GH jr0YOrozdRS+PkTaHkb3KS5Ay6bSKFoIoHSmWlQeMM4DTCmPF9Cf67QVRrTemJb6YGdh IQguHZkar6AVmuZnhpHEODOE/d/s+flk1kpWZXmc3tEy/+tNdBE8B5b3b5oA9iQ5IT8P ukpbsFA/QzJ9pSiN1KiOV5rfaD3c1NCuVEF3ZSUJI6wbGnE4MFMrQHv7+JfuXbodlkZT 0RzOqVphjJ3Xy/9oG+DR4xiBJNEvBH9mOc5iedu7GoawvP0cVpp7GaOkkc0rXkua0KFg JIMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=qlRWM/8qBxzL8xW8f2dB/NRQ6Ceza05Qtz1qnu4KGyU=; b=o9AeCZ+jJrNp0IGj4ENX9C7UsQiHdSmk0pxeD/SKQMxw8BHWEv/weuJrsEFMZD4QgM OAo5bc0fpAgW5QxImWaaVi9tJmnZDgV51A7QKk4AGp5+tboF/5RqyrWnWy0cw4Ot8B/E lTpVKK5slQy0DUT38KV3G/0OqXeoyqQqB1LBUjhmuiE3l33aJzy1mdm3aDzWB7uDVcr4 3ynXSyd6JtxjjhL8h5JbO7P79yapsAOWgxTn7WWMOlevxX5yQFTirSbEA9ffk39/zlbS sjc6PLXKbacIqDPuKpS3frDesnIc5h5wRDftSGOJxCTyDqzSzCH5+kbenuzc+VMrzuP5 r9rg== X-Gm-Message-State: AOAM532c3+hUdC3i4LYHZcfPmQbdPOcGxBvuym3Ys1n5O0QqoN2NSiLE kG36YZLi24ow/8zp7qWSQsjKS+/m5BF7o0bS X-Received: by 2002:a17:90a:e2c7:: with SMTP id fr7mr1955866pjb.140.1634596023504; Mon, 18 Oct 2021 15:27:03 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id k14sm14144967pfh.154.2021.10.18.15.27.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:02 -0700 (PDT) Message-ID: <6dd2c119-ab9f-2d8a-328a-37ee86ee1824@triularity.org> Date: Mon, 18 Oct 2021 15:27:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 2/6] fftools/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9N7KwtX7zA7s Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- fftools/cmdutils.c | 2 +- fftools/ffmpeg.c | 6 +++--- fftools/ffmpeg_filter.c | 6 +++--- fftools/ffmpeg_opt.c | 8 ++++---- fftools/ffplay.c | 8 ++++---- fftools/ffprobe.c | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c index 2c8e98982f..d351ceb7fa 100644 --- a/fftools/cmdutils.c +++ b/fftools/cmdutils.c @@ -2106,7 +2106,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id, AVFormatContext *s, AVStream *st, const AVCodec *codec) { AVDictionary *ret = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int flags = s->oformat ? AV_OPT_FLAG_ENCODING_PARAM : AV_OPT_FLAG_DECODING_PARAM; char prefix = 0; diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 9d4f9d7a2b..d46d154af1 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); @@ -3228,7 +3228,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 7aff43d917..d034ff2a5b 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))) { @@ -1073,7 +1073,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", @@ -1109,7 +1109,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; @@ -2212,7 +2212,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; if (o->stop_time != INT64_MAX && o->recording_time != INT64_MAX) { o->stop_time = INT64_MAX; diff --git a/fftools/ffplay.c b/fftools/ffplay.c index ccea0e4578..1183235624 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -1856,7 +1856,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int nb_pix_fmts = 0; int i, j; @@ -1960,7 +1960,7 @@ static int configure_audio_filters(VideoState *is, const char *afilters, int for int channels[2] = { 0, -1 }; AVFilterContext *filt_asrc = NULL, *filt_asink = NULL; char aresample_swr_opts[512] = ""; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; char asrc_args[256]; int ret; @@ -2575,7 +2575,7 @@ static int stream_component_open(VideoState *is, int stream_index) const AVCodec *codec; const char *forced_codec_name = NULL; AVDictionary *opts = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int sample_rate, nb_channels; int64_t channel_layout; int ret = 0; @@ -2760,7 +2760,7 @@ static int read_thread(void *arg) AVPacket *pkt = NULL; int64_t stream_start_time; int pkt_in_play_range = 0; - AVDictionaryEntry *t; + const AVDictionaryEntry *t; SDL_mutex *wait_mutex = SDL_CreateMutex(); int scan_all_pmts_set = 0; int64_t pkt_ts; diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 90e895bbf9..169c26b65c 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -580,7 +580,7 @@ static int writer_open(WriterContext **wctx, const Writer *writer, const char *a /* convert options to dictionary */ if (args) { AVDictionary *opts = NULL; - AVDictionaryEntry *opt = NULL; + const AVDictionaryEntry *opt = NULL; if ((ret = av_dict_parse_string(&opts, args, "=", ":", 0)) < 0) { av_log(*wctx, AV_LOG_ERROR, "Failed to parse option string '%s' provided to writer context\n", args); @@ -1836,7 +1836,7 @@ static void writer_register_all(void) static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; int ret = 0; if (!tags) @@ -2364,7 +2364,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream, print_int("max_content", metadata->MaxCLL); print_int("max_average", metadata->MaxFALL); } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) { - AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE); + const AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE); if (tag) print_str(tag->key, tag->value); print_int("size", sd->size); @@ -2957,7 +2957,7 @@ static int open_input_file(InputFile *ifile, const char *filename, { int err, i; AVFormatContext *fmt_ctx = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int scan_all_pmts_set = 0; fmt_ctx = avformat_alloc_context(); From patchwork Mon Oct 18 22:27:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31156 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3791635ioa; Mon, 18 Oct 2021 15:27:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMMCU08hZ6oK6cAHa4fLvjl34IP+00NxMliVMe1o1DfV76YRl7PY0yosIFyrHY5GKkbdCA X-Received: by 2002:a05:6402:40d3:: with SMTP id z19mr48793010edb.393.1634596061634; Mon, 18 Oct 2021 15:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596061; cv=none; d=google.com; s=arc-20160816; b=XHShWQ1YMyKRiNZ67nif9s4sKPoNREc193XGXB++CN1CzYQLeb3AjdKkIrd7oOVpFU Tj+NDsxf4bq3n4NCXhWFrQYtYo6kCCvXUDBte2BCRjzKMelyuCgBzIdYJDo1hUUA/AQN weOSf0KQaTZGMWNb5t22Atu190RrWoLjQTQgffVXxRB301OGEc6U3SPEtIhCTOCs93Mi A577qOBSuRLBBkV5D4jWsrHNYqCyGC+i4F9IiLYS10Ehrlz9TDYiP1pADQ6tnmbYLUkU ebchnpTN6Jo0mmhWcGRkItkTRrb1KSVa2X7i61Hl4LR2/usyohzuYOVk7F4F3MvqllTr 84Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=xVNoTnJXm4n/XFmb/qdJcW8ttvoj+14QOkxy++I2XEc=; b=w+NZrO8u5mamqYWs1vf+zPlLI75gvoloqd8WG2z5OSzxlk4QBYk6t2kfzDj42JKXvl 8jlu82nwRD7dU70uc4Xk313shLXpf1rGNv1JZ3u0xSTqJf8PE4VGve4uAgJYjtsOX9r6 adF4xYhe4m37GwiamDf8bIX1hyD1KiqWuGLdKQBsK5XUG0c7iXtZJr2M8QZiABj1HC4W A1q6LEgdnjQEivSRfLEK08RQoZ7TkRsPFlPslfyYCs8pcU1tEyErgvHxLyNZKXcWi/Wd raSlZ0/JuVioVzTpJsnzGOeI7Xnu16TNtREtq6pILd+faxwSZ19k41z6RmAtXgQ5eH8h MWAw== 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="Im/XuJfs"; 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 i20si18804182edx.16.2021.10.18.15.27.39; Mon, 18 Oct 2021 15:27:41 -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="Im/XuJfs"; 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 69C9568A786; Tue, 19 Oct 2021 01:27:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 55EAA68924E for ; Tue, 19 Oct 2021 01:27:11 +0300 (EEST) Received: by mail-pj1-f42.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so1142742pjb.0 for ; Mon, 18 Oct 2021 15:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=7OJL6wrkfeXg1Wt9cdEajN2SP6Mt2ic5kZr4V+CgP+w=; b=Im/XuJfsQG21k/wyPHlUTGKFVEPpKtKa/WYo0YYRbLyOaqELEpLZlaSQ1Rqbla2MqE RdLqCD0VvVoGNYGhQttgQBWSbTy6IlEGxZiXsZzjxaQ0LvHdO90QPGMpXB0YfqYZosLe Hme5Y3tJ/mkNnzccFBOMPi4J3JxZhEsg1eLEg/y9OmGo+3+orX+hDwoaUm8BALZmhS4e LaNVxeb2t0ncH7WLA8sRfyhIl390rswa5wBT+2CNHcK3WjJam0TXYYWLPhuwnv1qEGj1 mvttSQnh/dEIJyF9f5UbFU3trKIHugUFlff1d6fnr+5wfR5DUpWZY7vp2IuwIb4FMe6U j/YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=7OJL6wrkfeXg1Wt9cdEajN2SP6Mt2ic5kZr4V+CgP+w=; b=E1QDd8c78IfBUgc0EdnoAeoQRSx2uktwBV55D8JONCJbJoBCtYN2JNnjqfpqowIPcN ILqpJXpGVgtT/WrdC05YwsMlk+ryMWRaxwGZP0J366ikEu44qb96wHWYasiwhL0dkGOP jJihtAJDjlW+zFCK5DO1QSpNdqjqUkwNjSdOWv4/V9ohpgoz7PR+xcNIjF3tgIrVQhXp wK2hWH9pvHW+qsqYnfXf/Vaqlare5SI8vedCOJM2R4++rDzv2wUzYfVte9A7W2cVCnyu UpYrDbPTtrQIBg40rvW343WDq6n49qXWdp+tCHAQztDBovs+t9QKJehMEHPQXKE33dnN Reew== X-Gm-Message-State: AOAM531FTJ4AjUfc1CiF3iYvKYfqKzZw1VnAnYpptL1CmgOJ7foDPDKe FNYe0s2gMe9bktXhYXsJGEHOy6d/W5aMhlUscfw= X-Received: by 2002:a17:90a:a586:: with SMTP id b6mr1899816pjq.244.1634596029589; Mon, 18 Oct 2021 15:27:09 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id m7sm14046177pgn.32.2021.10.18.15.27.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:09 -0700 (PDT) Message-ID: <20e1fea7-f67c-e581-687a-28b4a749485f@triularity.org> Date: Mon, 18 Oct 2021 15:27:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 3/6] libavcodec/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 5hp0WpeMQZqW 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 507fee39f2..0251842bd4 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -931,7 +931,7 @@ static av_cold int X264_init(AVCodecContext *avctx) #endif { - AVDictionaryEntry *en = NULL; + const AVDictionaryEntry *en = NULL; while (en = av_dict_get(x4->x264_params, "", en, AV_DICT_IGNORE_SUFFIX)) { if ((ret = x264_param_parse(&x4->params, en->key, en->value)) < 0) { av_log(avctx, AV_LOG_WARNING, diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 7dd70a3450..ec50b8a77f 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -363,7 +363,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx) } { - AVDictionaryEntry *en = NULL; + const AVDictionaryEntry *en = NULL; while ((en = av_dict_get(ctx->x265_opts, "", en, AV_DICT_IGNORE_SUFFIX))) { int parse_ret = ctx->api->param_parse(ctx->params, en->key, en->value); diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7f89641660..b22895cfe6 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2407,7 +2407,7 @@ int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame) int i, index; int ret = 0; int is16bit; - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; s->force_pal8 = 0; From patchwork Mon Oct 18 22:27:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31152 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3791754ioa; Mon, 18 Oct 2021 15:27:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrsdztwA9ltUUBomQb+A3Z+9RxA4jU4Ph+2bpEDIuyZ7xOHJxGfykUxMPnV2mynMXra+9d X-Received: by 2002:a05:6402:b15:: with SMTP id bm21mr48028651edb.380.1634596073766; Mon, 18 Oct 2021 15:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596073; cv=none; d=google.com; s=arc-20160816; b=xRyRFays9UVxzdriy/5VD6dYVYsLSoaa68qS8ypgmDkeOZb+4t9HhNIyYwwGRCyob+ kYwhJRGT2qQzK6c4GzSANXp1F4onCEQXtAYFKWjhXc82zmwcCKWui3IEVAuiqQyqNx0S 5HUQZ3H61RUS8nQ3HMUOxefHUChVpqN556w5f9kXKvgv7myz8hlEnVOt4Rnn8jrxTLN2 mTT4mrMTp1VGbGptg5LyjYn8SNPcW3BtzpTfI/WLVaT5VlsO1lhb+jOKvCvIarnwjlRl M1Pp9KKY/PMeLPGHYg26HLSIyQ5MeHDfPNNIr5F9z75om8PhBMKiK4m+ElA/l1PAefTK 8ILw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=uYpCM2I+b7+DidcJu2d4tvNuv0mjg1ybGKNADeZrU30=; b=H+Li8nk50vtXsrJ0NdLfdc4GN/0E4K4Caz8qPNSDb2TESWSjvQ8Pot2cwrRBwwxItU SkZbkb1GspcKmXJyN+5B3Jrm9RS7L5bmExruP30TZpgauJ0rTJwT6kKHw7Q7FShcAC7A 8O4UiYKJclTjzET2w9q7shuhvON+vPXM579Po+I6UGASI9VB8bm+8pbcSMdwc1kJrOIU S3Rd5wD0kC2e6PtL8ASCC6wnwNSZTveYDqq6VVE1JufDlR3dk+gmjZgYZhBDbud4AJ6y HiJI86LwGLnNzrZ7fZZOQlOeOQem50ziTPFTeo1Wm8dnxtim09nb5yNTlNypqUaLwgPl UIAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=PB42Qoxe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f15si30344699edf.490.2021.10.18.15.27.52; Mon, 18 Oct 2021 15:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@triularity-org.20210112.gappssmtp.com header.s=20210112 header.b=PB42Qoxe; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6F7A768A867; Tue, 19 Oct 2021 01:27:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B982868A4CA for ; Tue, 19 Oct 2021 01:27:22 +0300 (EEST) Received: by mail-pj1-f42.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso493826pjb.4 for ; Mon, 18 Oct 2021 15:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=mAFMqIUx2JNxf/AN3DDdplXZytJ0UYRFwt2xxNPoL1s=; b=PB42Qoxe74KaG/3TQ3o8HqGE565fEfu9IzwMqWV7wdrKQs4/SCHXa2fEMtcKkrCGxx BUiHvLkm6aFWtbEUASQft/WSWa1tg/liepYYzTm2HyWbNw5FDVvLSk1wmd//zuxFz2PE wYrT70m7dpTzecIM40PRKa3JZuBnvNiaV9ki2noA302etUSwyJvg3RYRHjwtffl1woD5 hoPi+15z0udRTe0Jy7zQpUlPI+QcqgbzPmGxd8IAmKc2ytForh9MFK9pboiyhmkqH5Qr RmdH4EshN/zg6CD7ODc7GVvrO25eO+o1L8k7ji2PjUAuc/d2mWoLKXehzOr/8Ss8jPh1 B+ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=mAFMqIUx2JNxf/AN3DDdplXZytJ0UYRFwt2xxNPoL1s=; b=ltOuynG+PQXY9udbebdHrNrawIS6J7cBwdlMGw5X8ndNIokno0W7sT3sbDZ3LYK0Ij Ss+eXhkNLJpkcybydBu1m8A+v77Sw5kL5rpKXvYvoQlcL+sb6lIA0cP5sXsDn+wT9Y0V H57ivXAnf9QUmiQe35zBlOwFRgBaEYLGDBcnwZN6ax9b+/p+/GgVX2dNSbnMj+blC/3n IcW5oh56OXet9vTOpq74t+FXSPBaIr1u8kxh92g/WuRFKdqEbZiVVzTNqIiDy4a/Ptuz 52K3725AbssZtpYR3tplUl1hs4KO6K1B/9zsMIB6cviLGRIz9GMb3QhhbBlDS5gRKnr7 ZZWA== X-Gm-Message-State: AOAM5306Fj7ZFQTXq9II8rqK/StdhAScraW7XP91TJzzrqiAN+GJ6rbY 9QHMbQOFoQY5HRLyOr1ofO1MV2yu0RZ4a1fShJs= X-Received: by 2002:a17:90a:245:: with SMTP id t5mr1857323pje.133.1634596040729; Mon, 18 Oct 2021 15:27:20 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id e2sm13953258pfd.137.2021.10.18.15.27.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:20 -0700 (PDT) Message-ID: <95de62e3-a37f-6ecf-eb0d-ad213021e0b0@triularity.org> Date: Mon, 18 Oct 2021 15:27:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 4/6] libavfilter/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9FF3SKxjCE0B Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavfilter/avfilter.c | 2 +- libavfilter/f_bench.c | 2 +- libavfilter/f_drawgraph.c | 2 +- libavfilter/f_metadata.c | 2 +- libavfilter/f_select.c | 4 ++-- libavfilter/vf_cover_rect.c | 2 +- libavfilter/vf_drawtext.c | 2 +- libavfilter/vf_scale.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 7362bcdab5..9277aeea38 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -938,7 +938,7 @@ int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) int avfilter_init_str(AVFilterContext *filter, const char *args) { AVDictionary *options = NULL; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; int ret = 0; if (args && *args) { diff --git a/libavfilter/f_bench.c b/libavfilter/f_bench.c index f7098adaf4..16ca17723b 100644 --- a/libavfilter/f_bench.c +++ b/libavfilter/f_bench.c @@ -69,7 +69,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->action == ACTION_START) { av_dict_set_int(&in->metadata, START_TIME_KEY, t, 0); } else if (s->action == ACTION_STOP) { - AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); + const AVDictionaryEntry *e = av_dict_get(in->metadata, START_TIME_KEY, NULL, 0); if (e) { const int64_t start = strtoll(e->value, NULL, 0); const int64_t diff = t - start; diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index b6fcb3b75e..d34dc52a6b 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -163,7 +163,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) DrawGraphContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; AVDictionary *metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; int64_t in_pts, out_pts; diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c index cecfe62a9c..ee87a2b37f 100644 --- a/libavfilter/f_metadata.c +++ b/libavfilter/f_metadata.c @@ -306,7 +306,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterLink *outlink = ctx->outputs[0]; MetadataContext *s = ctx->priv; AVDictionary **metadata = &frame->metadata; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL, !s->key ? AV_DICT_IGNORE_SUFFIX: 0); diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c index 47e7d1fef8..fe7e294bf1 100644 --- a/libavfilter/f_select.c +++ b/libavfilter/f_select.c @@ -304,8 +304,8 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) static double get_concatdec_select(AVFrame *frame, int64_t pts) { AVDictionary *metadata = frame->metadata; - AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); - AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); + const AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0); + const AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0); if (start_time_entry) { int64_t start_time = strtoll(start_time_entry->value, NULL, 10); if (pts >= start_time) { diff --git a/libavfilter/vf_cover_rect.c b/libavfilter/vf_cover_rect.c index 01c9f2abbb..f094b2b593 100644 --- a/libavfilter/vf_cover_rect.c +++ b/libavfilter/vf_cover_rect.c @@ -124,7 +124,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) { AVFilterContext *ctx = inlink->dst; CoverContext *cover = ctx->priv; - AVDictionaryEntry *ex, *ey, *ew, *eh; + const AVDictionaryEntry *ex, *ey, *ew, *eh; int x = -1, y = -1, w = -1, h = -1; char *xendptr = NULL, *yendptr = NULL, *wendptr = NULL, *hendptr = NULL; diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index 2a88692cbd..14e6430368 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -1032,7 +1032,7 @@ static int func_metadata(AVFilterContext *ctx, AVBPrint *bp, char *fct, unsigned argc, char **argv, int tag) { DrawTextContext *s = ctx->priv; - AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); + const AVDictionaryEntry *e = av_dict_get(s->metadata, argv[0], NULL, 0); if (e && e->value) av_bprintf(bp, "%s", e->value); diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 44f85cb019..73bb3c0738 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -549,7 +549,7 @@ static int config_props(AVFilterLink *outlink) scale->out_range == AVCOL_RANGE_JPEG, 0); if (scale->opts) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; while ((e = av_dict_get(scale->opts, "", e, AV_DICT_IGNORE_SUFFIX))) { if ((ret = av_opt_set(s, e->key, e->value, 0)) < 0) return ret; From patchwork Mon Oct 18 22:27:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31154 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3791897ioa; Mon, 18 Oct 2021 15:28:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAjD4OUgQDMXjYFW3o+4+6UaW9AvxAvzI/pOxVwA59ybE7PvqcyrPERLlIHRql/fLBzwp0 X-Received: by 2002:a05:6402:27cd:: with SMTP id c13mr48343178ede.351.1634596084689; Mon, 18 Oct 2021 15:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596084; cv=none; d=google.com; s=arc-20160816; b=0fq58Lzyajq1jwDxEc++1ne5uYtUtyEbTUdG8UvNIHT2rXfkRVRal8y4Xq05LzItfY oh9BhsW4SUCZPc8AkoSXzvn0uW2x9zU0+BitqZl6jmyZUqww/A8fMIFYiZ+10I5vzHV2 bqi8144N955/PEXWNrOU8LC1bC089MFJ5ek6G2/kQcv9+LCGtVZ1z94sQmaQLwj8KrWH n30URjQwb4xTruuROFjtSO7W4POzc85wGOTff+7uAqDMxFoqxcsSzihXJzbjUi+fcmcE atKKy4f1yQVesbl2fV96psuXXFsuVMIgoTS03sPPQBYL3lnT/SKABIVhNyxQgEYmwXf2 HiIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=ZX3STG49Pg7EY+Ybs1eJiRhbkqY4nMHLxch/3IJMbls=; b=cF3AlPHgb/4icnC96XQ+NaSB0zcIQq/mZzDEcesfdBHZNPSYqqjkIAgfT1NpyRB0LX 1CVB1FwbUwRAlZx9hqTEggi1OtGyPHqaCnNSysPxufDMOtwGptp5eenmma6ZaxbbCEL5 sVutEkeU6K67khN6netY96O4rJnfYnvjR01vsw+DfmeWYjcBQQE0HoJg9tD/nFhgySlJ 6Gd4DRxS42tRVmHceyHycHpEkmsR69B8lfqmILEdeXIAjudFKF+XDr151KT/pdzKeBxQ +Lip3KaD039MxwOQdaeAJ75DzAc3uM9yyZLP2LflZz2P3i1FYD2qIcksvIR3gTUL/YBp exLQ== 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=ueuLipnD; 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 b1si21207977ejl.25.2021.10.18.15.28.04; Mon, 18 Oct 2021 15:28:04 -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=ueuLipnD; 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 816B468A87F; Tue, 19 Oct 2021 01:27:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E696668A4CA for ; Tue, 19 Oct 2021 01:27:31 +0300 (EEST) Received: by mail-pj1-f48.google.com with SMTP id om14so13198741pjb.5 for ; Mon, 18 Oct 2021 15:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=7UL3Ngp+nw0oQ+IVrdaYJx7EtMmijarbaXgIR2oT4iE=; b=ueuLipnDpUSJHS1n5qd6BVleGfWJWHsQQ2O7OJpZjjIvGlCED1HUCXkWdsB88BhRQG 2jXdLYB6ikt3WmqKY/EVtzDHj/63lb0YOfINV4tq7l9lIVea4rhkPBYN1G01vHlI668k wcZPP/uXKcogH6P+HVV9UsMFL4sDJf1UwOAA2rJFbcmMzn5QaomNxX3MgcUbulVVJFR/ aaqra1/1NIKjBVtlSKgJSMKAhuDzHiIJCQB+kHY+Xk4Xp6zuv9eyvlxzkaZDJJ4XvCs8 /Vunf3gr/ib8RIgh6O3ZN0bTgNEpuy9/MDwBmYERpvFnTPlHim2Tdv3/l3gxm2qPoI9s Ca0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=7UL3Ngp+nw0oQ+IVrdaYJx7EtMmijarbaXgIR2oT4iE=; b=baVewqav4GOuMFpE530nbr317G1QT7Fc8c4daofFXpTHO+ITgSm/GUGWpeloy5viiS lSHVzy99TZd8ct6Fj0ic/M/0WTl89/oKgks8PGRI1x7y16QCRakL5PWsVWOHUKn9xoAl AgZd981vI3e7Jl7LVtkRux6Afvxsow3+qiov8h3h/k94MDB7LGwG6DYNuKiUltmKUKL1 C5J2agpNurJ+k6o0TZTV49yIf+hOANbZKD3eOMGhAiU5xv33PlpY13SPcRGI/WYdX5vB IKVnkiKuXcA5D/DfDlZIzHAjr4HpkQEET3NhHeW4n3Lii6Q3oNjgIHSpn0PsaITcm0cS qFZg== X-Gm-Message-State: AOAM533Gt5R9KQ4KwKSB3ByzcY4FqMbIjKH2uNNwQhO5NxOLmV7Hsrft 2S8hEsfkLqpNHXi0q+jBWg2Ymb4nSNtD/gZmQ0Q= X-Received: by 2002:a17:902:e80c:b0:13f:1140:8ab2 with SMTP id u12-20020a170902e80c00b0013f11408ab2mr29915431plg.27.1634596049431; Mon, 18 Oct 2021 15:27:29 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id d13sm6594529pfu.196.2021.10.18.15.27.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:28 -0700 (PDT) Message-ID: <0483f9f0-dc56-6e57-dfcd-03de27fde1fa@triularity.org> Date: Mon, 18 Oct 2021 15:27:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 5/6] libavformat/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: kcqxUGgjsOFI Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavformat/aiffenc.c | 2 +- libavformat/apetag.c | 2 +- libavformat/asfenc.c | 8 +++---- libavformat/au.c | 2 +- libavformat/avidec.c | 2 +- libavformat/avienc.c | 2 +- libavformat/avio.c | 4 ++-- libavformat/cafenc.c | 2 +- libavformat/dashenc.c | 6 ++--- libavformat/dvenc.c | 2 +- libavformat/ffmetaenc.c | 2 +- libavformat/fifo.c | 2 +- libavformat/flacdec.c | 2 +- libavformat/flacenc.c | 4 ++-- libavformat/flvdec.c | 2 +- libavformat/flvenc.c | 2 +- libavformat/gxfenc.c | 2 +- libavformat/hls.c | 4 ++-- libavformat/http.c | 8 +++---- libavformat/id3v2.c | 6 ++--- libavformat/id3v2enc.c | 8 +++---- libavformat/matroskadec.c | 2 +- libavformat/metadata.c | 2 +- libavformat/mov.c | 6 ++--- libavformat/movenc.c | 44 ++++++++++++++++++------------------- libavformat/mp3enc.c | 6 ++--- libavformat/mpegtsenc.c | 6 ++--- libavformat/mux.c | 2 +- libavformat/mxfenc.c | 14 ++++++------ libavformat/nutenc.c | 6 ++--- libavformat/riffenc.c | 2 +- libavformat/rmenc.c | 2 +- libavformat/sapenc.c | 2 +- libavformat/sdp.c | 2 +- libavformat/segment.c | 4 ++-- libavformat/smjpegenc.c | 2 +- libavformat/soxenc.c | 2 +- libavformat/ttmlenc.c | 2 +- libavformat/utils.c | 4 ++-- libavformat/vorbiscomment.c | 6 ++--- libavformat/wavenc.c | 4 ++-- libavformat/webmdashenc.c | 28 +++++++++++------------ libavformat/wtvenc.c | 4 ++-- 43 files changed, 113 insertions(+), 113 deletions(-) diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c index 24bc17400e..1f8e0dd670 100644 --- a/libavformat/aiffenc.c +++ b/libavformat/aiffenc.c @@ -82,7 +82,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff) static void put_meta(AVFormatContext *s, const char *key, uint32_t id) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; AVIOContext *pb = s->pb; if (tag = av_dict_get(s->metadata, key, NULL, 0)) { diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 6f82fbe202..d94356f5a0 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -174,7 +174,7 @@ static int string_is_ascii(const uint8_t *str) int ff_ape_write_tag(AVFormatContext *s) { - AVDictionaryEntry *e = NULL; + const AVDictionaryEntry *e = NULL; int size, ret, count = 0; AVIOContext *dyn_bc; uint8_t *dyn_buf; diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 041019b186..a60e5ac83d 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -327,7 +327,7 @@ static void asf_write_markers(AVFormatContext *s, AVIOContext *dyn_buf) 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); @@ -357,7 +357,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb, *dyn_buf; - 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; @@ -388,7 +388,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 */ @@ -566,7 +566,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 b10c3efa61..22e14a10c7 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 3fbde0be1e..8002022bc0 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 3401aebe8d..93add8a193 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -174,7 +174,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 f884e5d2c8..74033ad26b 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 133d1e9fb3..8c660e6dc6 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 52a031ed54..f8b5a46197 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1075,8 +1075,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 b2c4927e43..da47fb9a45 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2056,7 +2056,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 57c67e3aac..44aeb1e412 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2156,7 +2156,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 */ @@ -7775,7 +7775,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; @@ -7938,7 +7938,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 d43a086f4b..9a2b9c7abd 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; @@ -3616,11 +3616,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; @@ -3646,7 +3646,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); @@ -3655,7 +3655,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; @@ -3677,7 +3677,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"; @@ -3725,7 +3725,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; @@ -3753,7 +3753,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; @@ -3862,7 +3862,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; @@ -3891,7 +3891,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 */ @@ -3936,7 +3936,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; @@ -3974,7 +3974,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 */ @@ -4005,7 +4005,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))) { @@ -4091,7 +4091,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) { @@ -4328,7 +4328,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"; @@ -6317,7 +6317,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}); @@ -6681,13 +6681,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; @@ -6747,7 +6747,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 e4b2a65b07..947116fd0c 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 a6e1a08be0..e78d9a3c31 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 c36ebef932..83540b8dd2 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -759,9 +759,9 @@ static void mxf_write_identification(AVFormatContext *s) { MXFContext *mxf = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *com_entry = av_dict_get(s->metadata, "company_name", NULL, 0); - AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); - AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); + const AVDictionaryEntry *com_entry = av_dict_get(s->metadata, "company_name", NULL, 0); + const AVDictionaryEntry *product_entry = av_dict_get(s->metadata, "product_name", NULL, 0); + const AVDictionaryEntry *version_entry = av_dict_get(s->metadata, "product_version", NULL, 0); const char *company = com_entry ? com_entry->value : "FFmpeg"; const char *product = product_entry ? product_entry->value : s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer"; const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFORM_IDENT; @@ -1540,7 +1540,7 @@ static int mxf_write_tagged_value(AVFormatContext *s, const char* name, const ch static int mxf_write_user_comments(AVFormatContext *s, const AVDictionary *m) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; int count = 0; while ((t = av_dict_get(m, "comment_", t, AV_DICT_IGNORE_SUFFIX))) { @@ -1680,7 +1680,7 @@ static int mxf_write_essence_container_data(AVFormatContext *s) static int mxf_write_header_metadata_sets(AVFormatContext *s) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *entry = NULL; + const AVDictionaryEntry *entry = NULL; AVStream *st = NULL; int i; MXFPackage packages[3] = {{0}}; @@ -2479,7 +2479,7 @@ static void mxf_gen_umid(AVFormatContext *s) static int mxf_init_timecode(AVFormatContext *s, AVStream *st, AVRational tbc) { MXFContext *mxf = s->priv_data; - AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *tcr = av_dict_get(s->metadata, "timecode", NULL, 0); if (!ff_mxf_get_content_package_rate(tbc)) { if (s->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) { @@ -2655,7 +2655,7 @@ static int mxf_write_header(AVFormatContext *s) if (ret < 0) return ret; } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { - AVDictionaryEntry *e = av_dict_get(st->metadata, "data_type", NULL, 0); + const AVDictionaryEntry *e = av_dict_get(st->metadata, "data_type", NULL, 0); if (e && !strcmp(e->value, "vbi_vanc_smpte_436M")) { sc->index = INDEX_S436M; } else { diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 7977980935..54727f21bc 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -494,7 +494,7 @@ static int add_info(AVIOContext *bc, const char *type, const char *value) static int write_globalinfo(NUTContext *nut, AVIOContext *bc) { AVFormatContext *s = nut->avf; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; int count = 0, dyn_size; @@ -522,7 +522,7 @@ static int write_globalinfo(NUTContext *nut, AVIOContext *bc) static int write_streaminfo(NUTContext *nut, AVIOContext *bc, int stream_id) { AVFormatContext *s= nut->avf; AVStream* st = s->streams[stream_id]; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *dyn_bc; uint8_t *dyn_buf=NULL; int count=0, dyn_size, i; @@ -565,7 +565,7 @@ static int write_chapter(NUTContext *nut, AVIOContext *bc, int id) { AVIOContext *dyn_bc; uint8_t *dyn_buf = NULL; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVChapter *ch = nut->avf->chapters[id]; int ret, dyn_size, count = 0; diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c index ffccfa3d48..be66c7bdce 100644 --- a/libavformat/riffenc.c +++ b/libavformat/riffenc.c @@ -337,7 +337,7 @@ void ff_riff_write_info(AVFormatContext *s) AVIOContext *pb = s->pb; int i; int64_t list_pos; - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; ff_metadata_conv(&s->metadata, ff_riff_info_conv, NULL); diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index 1b2b0ecf38..d0b76b7a54 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -76,7 +76,7 @@ static int rv10_write_header(AVFormatContext *ctx, int nb_packets, packet_total_size, packet_max_size, size, packet_avg_size, i; int bit_rate, v, duration, flags; int data_offset; - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; ffio_wfourcc(s, ".RMF"); avio_wb32(s,18); /* header size */ diff --git a/libavformat/sapenc.c b/libavformat/sapenc.c index 9319ee6f80..0c0e17d986 100644 --- a/libavformat/sapenc.c +++ b/libavformat/sapenc.c @@ -76,7 +76,7 @@ static int sap_write_header(AVFormatContext *s) struct sockaddr_storage localaddr; socklen_t addrlen = sizeof(localaddr); int udp_fd; - AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0); + const AVDictionaryEntry* title = av_dict_get(s->metadata, "title", NULL, 0); if (!ff_network_init()) return AVERROR(EIO); diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 1200e553f9..2d8f61f9b8 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -757,7 +757,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size) { - AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0); + const AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0); struct sdp_session_level s = { 0 }; int i, j, port, ttl, is_multicast, index = 0; char dst[32], dst_type[5]; diff --git a/libavformat/segment.c b/libavformat/segment.c index 2b024fd373..b11a183322 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -349,7 +349,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) int ret = 0; AVTimecode tc; AVRational rate; - AVDictionaryEntry *tcr; + const AVDictionaryEntry *tcr; char buf[AV_TIMECODE_STR_SIZE]; int i; int err; @@ -435,7 +435,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) char st_buf[AV_TIMECODE_STR_SIZE]; AVTimecode st_tc; AVRational st_rate = s->streams[i]->avg_frame_rate; - AVDictionaryEntry *st_tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0); + const AVDictionaryEntry *st_tcr = av_dict_get(s->streams[i]->metadata, "timecode", NULL, 0); if (st_tcr) { if ((av_timecode_init_from_string(&st_tc, st_rate, st_tcr->value, s) < 0)) { av_log(s, AV_LOG_WARNING, "Could not increment stream %d timecode, error occurred during timecode creation.\n", i); diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c index ac5576fa76..56d00c1d1b 100644 --- a/libavformat/smjpegenc.c +++ b/libavformat/smjpegenc.c @@ -34,7 +34,7 @@ typedef struct SMJPEGMuxContext { static int smjpeg_write_header(AVFormatContext *s) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVIOContext *pb = s->pb; int n, tag; diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c index e24501bacd..9b934f9f6e 100644 --- a/libavformat/soxenc.c +++ b/libavformat/soxenc.c @@ -46,7 +46,7 @@ static int sox_write_header(AVFormatContext *s) SoXContext *sox = s->priv_data; AVIOContext *pb = s->pb; AVCodecParameters *par = s->streams[0]->codecpar; - AVDictionaryEntry *comment; + const AVDictionaryEntry *comment; size_t comment_len = 0, comment_size; comment = av_dict_get(s->metadata, "comment", NULL, 0); diff --git a/libavformat/ttmlenc.c b/libavformat/ttmlenc.c index 896fc81958..21aa8e4ed5 100644 --- a/libavformat/ttmlenc.c +++ b/libavformat/ttmlenc.c @@ -135,7 +135,7 @@ static int ttml_write_header(AVFormatContext *ctx) AVStream *st = ctx->streams[0]; AVIOContext *pb = ctx->pb; - AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, + const AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); const char *printed_lang = (lang && lang->value) ? lang->value : ""; diff --git a/libavformat/utils.c b/libavformat/utils.c index 509c0ecdce..5aaee9abb0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1434,7 +1434,7 @@ static int match_stream_specifier(AVFormatContext *s, AVStream *st, return AVERROR(EINVAL); return match && (stream_id == st->id); } else if (*spec == 'm' && *(spec + 1) == ':') { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; char *key, *val; int ret; @@ -1809,7 +1809,7 @@ int ff_is_http_proto(const char *filename) { int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds) { - AVDictionaryEntry *entry; + const AVDictionaryEntry *entry; int64_t parsed_timestamp; int ret; if ((entry = av_dict_get(s->metadata, "creation_time", NULL, 0))) { diff --git a/libavformat/vorbiscomment.c b/libavformat/vorbiscomment.c index 13ee065a44..0340465f57 100644 --- a/libavformat/vorbiscomment.c +++ b/libavformat/vorbiscomment.c @@ -45,7 +45,7 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string len += strlen(vendor_string); if (chapters && nb_chapters) { for (int i = 0; i < nb_chapters; i++) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; len += 4 + 12 + 1 + 10; while ((tag = av_dict_get(chapters[i]->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) { int64_t len1 = !strcmp(tag->key, "title") ? 4 : strlen(tag->key); @@ -54,7 +54,7 @@ int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string } } if (m) { - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { len += 4 +strlen(tag->key) + 1 + strlen(tag->value); } @@ -77,7 +77,7 @@ int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, } if (m) { int count = av_dict_count(m) + cm_count; - AVDictionaryEntry *tag = NULL; + const AVDictionaryEntry *tag = NULL; avio_wl32(pb, count); while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) { int64_t len1 = strlen(tag->key); diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c index 2317700be1..c1189aa3ac 100644 --- a/libavformat/wavenc.c +++ b/libavformat/wavenc.c @@ -88,7 +88,7 @@ typedef struct WAVMuxContext { #if CONFIG_WAV_MUXER static inline void bwf_write_bext_string(AVFormatContext *s, const char *key, int maxlen) { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; size_t len = 0; if (tag = av_dict_get(s->metadata, key, NULL, 0)) { @@ -102,7 +102,7 @@ static inline void bwf_write_bext_string(AVFormatContext *s, const char *key, in static void bwf_write_bext_chunk(AVFormatContext *s) { - AVDictionaryEntry *tmp_tag; + const AVDictionaryEntry *tmp_tag; uint64_t time_reference = 0; int64_t bext = ff_start_tag(s->pb, "bext"); diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index cf69bd35b1..0dfc75c33d 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -68,7 +68,7 @@ static double get_duration(AVFormatContext *s) int i = 0; double max = 0.0; for (i = 0; i < s->nb_streams; i++) { - AVDictionaryEntry *duration = av_dict_get(s->streams[i]->metadata, + const AVDictionaryEntry *duration = av_dict_get(s->streams[i]->metadata, DURATION, NULL, 0); if (!duration || atof(duration->value) < 0) continue; if (atof(duration->value) > max) max = atof(duration->value); @@ -127,11 +127,11 @@ static void write_footer(AVFormatContext *s) static int subsegment_alignment(AVFormatContext *s, const AdaptationSet *as) { int i; - AVDictionaryEntry *gold = av_dict_get(s->streams[as->streams[0]]->metadata, + const AVDictionaryEntry *gold = av_dict_get(s->streams[as->streams[0]]->metadata, CUE_TIMESTAMPS, NULL, 0); if (!gold) return 0; for (i = 1; i < as->nb_streams; i++) { - AVDictionaryEntry *ts = av_dict_get(s->streams[as->streams[i]]->metadata, + const AVDictionaryEntry *ts = av_dict_get(s->streams[as->streams[i]]->metadata, CUE_TIMESTAMPS, NULL, 0); if (!ts || !av_strstart(ts->value, gold->value, NULL)) return 0; } @@ -142,13 +142,13 @@ static int bitstream_switching(AVFormatContext *s, const AdaptationSet *as) { int i; const AVStream *gold_st = s->streams[as->streams[0]]; - AVDictionaryEntry *gold_track_num = av_dict_get(gold_st->metadata, + const AVDictionaryEntry *gold_track_num = av_dict_get(gold_st->metadata, TRACK_NUMBER, NULL, 0); AVCodecParameters *gold_par = gold_st->codecpar; if (!gold_track_num) return 0; for (i = 1; i < as->nb_streams; i++) { const AVStream *st = s->streams[as->streams[i]]; - AVDictionaryEntry *track_num = av_dict_get(st->metadata, + const AVDictionaryEntry *track_num = av_dict_get(st->metadata, TRACK_NUMBER, NULL, 0); AVCodecParameters *par = st->codecpar; if (!track_num || @@ -174,7 +174,7 @@ static int write_representation(AVFormatContext *s, AVStream *st, char *id, WebMDashMuxContext *w = s->priv_data; AVIOContext *pb = s->pb; const AVCodecParameters *par = st->codecpar; - AVDictionaryEntry *bandwidth = av_dict_get(st->metadata, BANDWIDTH, NULL, 0); + const AVDictionaryEntry *bandwidth = av_dict_get(st->metadata, BANDWIDTH, NULL, 0); const char *bandwidth_str; avio_printf(pb, ""); } else { - AVDictionaryEntry *irange = av_dict_get(st->metadata, INITIALIZATION_RANGE, NULL, 0); - AVDictionaryEntry *cues_start = av_dict_get(st->metadata, CUES_START, NULL, 0); - AVDictionaryEntry *cues_end = av_dict_get(st->metadata, CUES_END, NULL, 0); - AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); + const AVDictionaryEntry *irange = av_dict_get(st->metadata, INITIALIZATION_RANGE, NULL, 0); + const AVDictionaryEntry *cues_start = av_dict_get(st->metadata, CUES_START, NULL, 0); + const AVDictionaryEntry *cues_end = av_dict_get(st->metadata, CUES_END, NULL, 0); + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); if (!irange || !cues_start || !cues_end || !filename) return AVERROR(EINVAL); @@ -304,7 +304,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) AdaptationSet *as = &w->as[as_index]; const AVStream *st = s->streams[as->streams[0]]; AVCodecParameters *par = st->codecpar; - AVDictionaryEntry *lang; + const AVDictionaryEntry *lang; AVIOContext *pb = s->pb; int i; static const char boolean[2][6] = { "false", "true" }; @@ -344,7 +344,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) boolean[w->is_live || subsegment_alignment(s, as)]); for (i = 0; i < as->nb_streams; i++) { - AVDictionaryEntry *kf = av_dict_get(s->streams[as->streams[i]]->metadata, + const AVDictionaryEntry *kf = av_dict_get(s->streams[as->streams[i]]->metadata, CLUSTER_KEYFRAME, NULL, 0); if (!w->is_live && (!kf || !strncmp(kf->value, "0", 1))) subsegmentStartsWithSAP = 0; } @@ -352,7 +352,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) avio_printf(pb, ">\n"); if (w->is_live) { - AVDictionaryEntry *filename = + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); char *underscore_pos, *period_pos; int ret; @@ -380,7 +380,7 @@ static int write_adaptation_set(AVFormatContext *s, int as_index) AVStream *st = s->streams[as->streams[i]]; int ret; if (w->is_live) { - AVDictionaryEntry *filename = + const AVDictionaryEntry *filename = av_dict_get(st->metadata, FILENAME, NULL, 0); if (!filename) return AVERROR(EINVAL); diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c index 9c67a6d3e8..e35c9909c0 100644 --- a/libavformat/wtvenc.c +++ b/libavformat/wtvenc.c @@ -670,7 +670,7 @@ static void write_table_entries_attrib(AVFormatContext *s) { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = 0; ff_standardize_creation_time(s); //FIXME: translate special tags (e.g. WM/Bitrate) to binary representation @@ -698,7 +698,7 @@ static void write_table_redirector_legacy_attrib(AVFormatContext *s) { WtvContext *wctx = s->priv_data; AVIOContext *pb = s->pb; - AVDictionaryEntry *tag = 0; + const AVDictionaryEntry *tag = 0; int64_t pos = 0; //FIXME: translate special tags to binary representation From patchwork Mon Oct 18 22:27:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chad Fraleigh X-Patchwork-Id: 31155 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2084:0:0:0:0 with SMTP id a4csp3792035ioa; Mon, 18 Oct 2021 15:28:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxltm0T5Oy0dbRZXOwhjcvsyBzmHjLdw+d1AqCsxrfC2cX5WbaLhsyyeHwtMDCmiUHkwvD X-Received: by 2002:a05:6402:5252:: with SMTP id t18mr46770350edd.129.1634596096673; Mon, 18 Oct 2021 15:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634596096; cv=none; d=google.com; s=arc-20160816; b=FbgWqWsf2ZwlqsqrUX46WHmqXnCl3abKOSfSlVGh6+PVaYl07Pom3bx4Drb+zU4dQv Xfnqsqi8U2EULaDH1JQmcVBpsMlojUECE0h5B+wyTYf1q9sNw6OCfybzsrffukg9RrxU dK0iKIEFup0OlgmhdCJnTe0s5pOBFvzSMzymCsJ+skcd9uKISD5AU98pibDGoYzM3V9w ot/mUUcSPrS5x7Z5ED/j7tF65MHPcXMzoj3gKaYjspPpq/W+Vi2DJIocvNloTqnh7LES 8qwjkYWn66XQXQWZIOUEVNf4O0O5KnYTCmIfaEnmYQNBdoa1kbDO3sMDbmH2YePZLSJd 7HoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:content-language:to:from:user-agent:mime-version :date:message-id:dkim-signature:delivered-to; bh=lJVgbXg0KW+EWDZHtG8U7mkXetvEAaUJAXZTr71za8s=; b=qByuiJmIL0OKcEaRIUuql/HbUg4+UcoHrwB/7Fa+74HwKnzxSOyrTJO3036Xnw6xHG gxdgw/mt9Uv891psQoCAQgtunOgG2VGSMpmomof9tUMvCkTS7Da/nEqNlwSnSN+Fiijr yOc/LK1bOkIZfQ1VS5hedLSSWU4njIhT6KuhlTdkZimn6VrPbJoVU++OGntLLQJwPuWh EKolifcLafKSD7DM1Z7UtmJucGEoMoXY7g/hIAxAV58DBAmpi7PUoB+/HzW8uGV/TOAI fpB1MSyaArqdwg4EOOXM9KKPjBBWv+vstMBmif43/apktMuda3bHTkBLuHUbpIDi0Jox GsdA== 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=jN3Oj5Us; 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 f17si21648486ejb.60.2021.10.18.15.28.16; Mon, 18 Oct 2021 15:28:16 -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=jN3Oj5Us; 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 93E4468A89E; Tue, 19 Oct 2021 01:27:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 09E9D68A576 for ; Tue, 19 Oct 2021 01:27:41 +0300 (EEST) Received: by mail-pf1-f170.google.com with SMTP id k26so15891230pfi.5 for ; Mon, 18 Oct 2021 15:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triularity-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:from:subject:to :content-language:content-transfer-encoding; bh=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=jN3Oj5UsIlYfORhHisjj6dYkQgZ+AnSN/QcYgvsd96qWXiXF/blZGW1k2WoIJ4m2/M To38lwZA0VuRRmdrfxVt6sN3seERqajdrU6IhzPy+6ZN96iVakFzkG1JOnyPiddgIbfQ IWQot4xTum3CNSpzh1Gmb+lbkhcJN47/2VkXMoWXcxsQoFPYKJcOKb/9zRipRpT0rUTy kr6E7/mXrj2dgpRKpEeeYYHspMe0tZn7/pWLbgOxzN8xjelznK35NX4e7kxVNyUxJKiI EpIEgFTqPrwTJWJ4439PCctGSLUWPwEz3W3R2wsO4/n43hJHDt2Q46XI8/o/bH1Wxgtu o+pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:from :subject:to:content-language:content-transfer-encoding; bh=cetBZsRgQ2a4qwssuMvGfbOFnuN/852jE17Su61/Aok=; b=SPBNOcbbZ8w5u6JFlVItvTkAYVyRxQm7jigJ2EOtlUgaNwFt8s2i/6xoJYyIQA/KAn vgk6WIi+fgl6rKPfX6tN4KlFdlUFgTW9/WN8irvTAutVM9rsca61FFJpHTd4jEEO28DC IBAkkP2KhdZs9v5i5eeze40HWXOej/ceC4QSqeSBCAoutlS1/ABGrwny5Itw+1zxE12v Fkvu3EUb7pj4LF29qRWkwVpgzvpx1ZD5WNoul8I3LiK/u09rl1fWVAOqBRNUb+FBQf1/ KlKZVqb9lPJ8UaAMioq/0SSOpENJnHA6KJeJ7CyDxplN+o1WKPypY2zg+lBK+Fc9FoaE K5+g== X-Gm-Message-State: AOAM5332EGCE0MQ7161TXTKWMDt63i7NKWhsYQ09D4aNXUyh2nNhup7c YP7vtBmrnIaZi7sRs72/JaL+m9Y/9RnpPEwDUms= X-Received: by 2002:a63:b34a:: with SMTP id x10mr25731337pgt.473.1634596059127; Mon, 18 Oct 2021 15:27:39 -0700 (PDT) Received: from ?IPV6:2601:603:5000:f89:5947:de06:6c2c:d8c6? ([2601:603:5000:f89:5947:de06:6c2c:d8c6]) by smtp.gmail.com with ESMTPSA id x7sm14096663pfj.164.2021.10.18.15.27.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 15:27:38 -0700 (PDT) Message-ID: <5d8852f8-9b98-82e3-5cad-f4023cdae770@triularity.org> Date: Mon, 18 Oct 2021 15:27:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 From: Chad Fraleigh To: ffmpeg-devel@ffmpeg.org Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 6/6] libavutil/: constify values from av_dict_get(). X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: erUG5/ZU/3yt Treat values returned from av_dict_get() as const, since they are internal to AVDictionary. Signed-off-by: Chad Fraleigh --- libavutil/hwcontext_qsv.c | 2 +- libavutil/hwcontext_vulkan.c | 6 +++--- libavutil/opt.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index c18747f7eb..23023c005d 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcontext_qsv.c @@ -1451,7 +1451,7 @@ static int qsv_device_create(AVHWDeviceContext *ctx, const char *device, enum AVHWDeviceType child_device_type; AVHWDeviceContext *child_device; AVDictionary *child_device_opts; - AVDictionaryEntry *e; + const AVDictionaryEntry *e; mfxIMPL impl; int ret; diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2c3216857a..259fa12cba 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -545,7 +545,7 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts, int optional_exts_num; uint32_t sup_ext_count; char *user_exts_str = NULL; - AVDictionaryEntry *user_exts; + const AVDictionaryEntry *user_exts; VkExtensionProperties *sup_ext; const VulkanOptExtension *optional_exts; @@ -671,7 +671,7 @@ static int create_instance(AVHWDeviceContext *ctx, AVDictionary *opts) VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; - AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); + const AVDictionaryEntry *debug_opt = av_dict_get(opts, "debug", NULL, 0); const int debug_mode = debug_opt && strtol(debug_opt->value, NULL, 10); VkApplicationInfo application_info = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, @@ -1246,7 +1246,7 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, { int err = 0; VkResult ret; - AVDictionaryEntry *opt_d; + const AVDictionaryEntry *opt_d; VulkanDevicePriv *p = ctx->internal->priv; VulkanFunctions *vk = &p->vkfn; AVVulkanDeviceContext *hwctx = ctx->hwctx; diff --git a/libavutil/opt.c b/libavutil/opt.c index c7001dbcd3..51b9157c2e 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1633,7 +1633,7 @@ void av_opt_free(void *obj) int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags) { - AVDictionaryEntry *t = NULL; + const AVDictionaryEntry *t = NULL; AVDictionary *tmp = NULL; int ret; @@ -2005,8 +2005,8 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o) case AV_OPT_TYPE_DICT: { AVDictionary *dict1 = NULL; AVDictionary *dict2 = *(AVDictionary **)dst; - AVDictionaryEntry *en1 = NULL; - AVDictionaryEntry *en2 = NULL; + const AVDictionaryEntry *en1 = NULL; + const AVDictionaryEntry *en2 = NULL; ret = av_dict_parse_string(&dict1, o->default_val.str, "=", ":", 0); if (ret < 0) { av_dict_free(&dict1);