From patchwork Sun Jan 27 21:38:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 11883 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A02DA44C7DD for ; Sun, 27 Jan 2019 23:38:14 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6AA768AF3C; Sun, 27 Jan 2019 23:38:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 46E3B68AF18 for ; Sun, 27 Jan 2019 23:37:56 +0200 (EET) Received: by mail-io1-f49.google.com with SMTP id m19so11883348ioh.3 for ; Sun, 27 Jan 2019 13:38:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Bn0fkldBKQ6tcWcRYiAhbHDIh2j1pSW1mH5rXo1+4Mk=; b=q/ANxWjF5oC8eht+M50UuNwPCR7dWbznjNqzADccx2mZl5RWMfWWvqvaCy7llS4g3u O0hThN0I2xqwdtW6TfkANE4v4vYMRQtZoplmOvrS5M6tp2OPWDb51kSts8tW79JCMVyT d60zXoR7Rvnl3N7tKGWd+W+s9tHZFIj3gHHsTeYdKgKzt6XNqWQ61pxSYT/+6CEMJ5Dw t10tnnvASehf6qBJzBsHYBnUllbxFV9FBCkjTX7uFxwF2+lwL75oeWOnLZTARfJVRkWa kILm9dARLn9UBPcVUkHWSThApFFxKNdOqeJIqLr4x+rBouExJ8TRMSbSb8qxtVPFM4sT 9YjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Bn0fkldBKQ6tcWcRYiAhbHDIh2j1pSW1mH5rXo1+4Mk=; b=OlPqOS/uxVgFShCyZoSRXULfs2gKe4VVs7L8LUNor86qUm3LsSlWXJ5kHysWYl4j8R s0yyRKfaccBBIyvID5FAqO8qmi3uqFCORtBK7jBO/cTp4hfLKUeSz1lq6bSPsow+KYfK JuAGrO/+yZPQe09dwhiE3oTXaYgiVHEP/rf9dQAGms/Hzzi9mEOxTvZUh4JzWwIetiCV 4goQNECGNHto13/hqIFueeskzkQ0Hx9inmWAB7Fpqa1nf3DhMMsnE1ms61JSLuvzxlNM Kxs8AROZYcRlw6lU0x6/8t6GO3eCobZ+LyIbOxnGrjKC8Yb/Cm6xkKSBwy+NiRdK3k3Z sfug== X-Gm-Message-State: AJcUukff394pWB0+9gcON1wxCjUyUKLJmlhTAKnyx+MhggidJWn/ht5P kZv/mzMY1IuEthjfSRqGRfjo5t3t1QtIoi3IJEyWNA== X-Google-Smtp-Source: AHgI3IbQ5Rr2ch6QaKK+bIfNaE8sZ+bcwtG1DMRH4zZ1ZdjdQYh8CuVaqzQjv0bIc0xyopQTzifykKncnFP0rOJdsxg= X-Received: by 2002:a5d:9405:: with SMTP id v5mr11963966ion.250.1548625094547; Sun, 27 Jan 2019 13:38:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a02:5f11:0:0:0:0:0 with HTTP; Sun, 27 Jan 2019 13:38:13 -0800 (PST) From: Carl Eugen Hoyos Date: Sun, 27 Jan 2019 22:38:13 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavf:Constify AVInputFormat pointer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Hi! Attached patch was requested in ticket #7220 iiuc. Please review, Carl Eugen From a713b58767e8d77b641d1b87e68de11c176fd454 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 27 Jan 2019 22:35:51 +0100 Subject: [PATCH] lavf: Constify AVInputFormat pointer. --- libavformat/avformat.h | 8 ++++---- libavformat/format.c | 4 ++-- libavformat/hls.c | 2 +- libavformat/utils.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index fdaffa5..9cfdbe8 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1346,7 +1346,7 @@ typedef struct AVFormatContext { * * Demuxing only, set by avformat_open_input(). */ - struct AVInputFormat *iformat; + const struct AVInputFormat *iformat; /** * The output container format. @@ -2272,14 +2272,14 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score * the maximal score is AVPROBE_SCORE_MAX * AVERROR code otherwise */ -int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat const **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size); /** * Like av_probe_input_buffer2() but returns 0 on success */ -int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size); @@ -2302,7 +2302,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, * * @note If you want to use custom IO, preallocate the format context and set its pb field. */ -int avformat_open_input(AVFormatContext **ps, const char *url, AVInputFormat *fmt, AVDictionary **options); +int avformat_open_input(AVFormatContext **ps, const char *url, const AVInputFormat *fmt, AVDictionary **options); attribute_deprecated int av_demuxer_open(AVFormatContext *ic); diff --git a/libavformat/format.c b/libavformat/format.c index 2c4c895..157e09a 100644 --- a/libavformat/format.c +++ b/libavformat/format.c @@ -219,7 +219,7 @@ AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) return av_probe_input_format2(pd, is_opened, &score); } -int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { @@ -309,7 +309,7 @@ fail: return ret < 0 ? ret : score; } -int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, +int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { diff --git a/libavformat/hls.c b/libavformat/hls.c index 8975a87..4c2265a 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1868,7 +1868,7 @@ static int hls_read_header(AVFormatContext *s) /* Open the demuxer for each playlist */ for (i = 0; i < c->n_playlists; i++) { struct playlist *pls = c->playlists[i]; - AVInputFormat *in_fmt = NULL; + const AVInputFormat *in_fmt = NULL; if (!(pls->ctx = avformat_alloc_context())) { ret = AVERROR(ENOMEM); diff --git a/libavformat/utils.c b/libavformat/utils.c index 7afef54..98e8849 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -535,7 +535,7 @@ FF_ENABLE_DEPRECATION_WARNINGS int avformat_open_input(AVFormatContext **ps, const char *filename, - AVInputFormat *fmt, AVDictionary **options) + const AVInputFormat *fmt, AVDictionary **options) { AVFormatContext *s = *ps; int i, ret = 0; @@ -2163,7 +2163,7 @@ static int64_t ff_read_timestamp(AVFormatContext *s, int stream_index, int64_t * int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags) { - AVInputFormat *avif = s->iformat; + const AVInputFormat *avif = s->iformat; int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; int64_t ts_min, ts_max, ts; int index; -- 1.7.10.4