From patchwork Wed Nov 27 07:48:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 16442 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 511F644ACB4 for ; Wed, 27 Nov 2019 09:49:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 31F7968B0C5; Wed, 27 Nov 2019 09:49:36 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D1B0168B0B2 for ; Wed, 27 Nov 2019 09:49:27 +0200 (EET) Received: by mail-wm1-f68.google.com with SMTP id l1so5946108wme.2 for ; Tue, 26 Nov 2019 23:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uvn8rG91KVV+1C8E5vq6QUp1dy2AFq5XyUIBPKg1+A0=; b=Zo1eR0FJ0KkYMGrib4OXjjuhgdHfFULbdwAJAyeHTJ02+Ea1Oj0dY9hROhiuvrM01W 8x3JE64BV1yGfjChzc47n+diQsrfWkTzoD7S4JqL3pB4d39eoserePWxxq5idweraxY3 eRvVj08u5nmoshhMq2wwwf0EW6/Kmr025wSsbHUpjME3wxW5N5rbAup7w/SSy42z9ccr 4EINe/8KM81z6lB5POjX20OCxQngwnNIu6pdhbvJfS1U7Hp0Pz4ILjNPvKqMUkSxeQpt KIetNb8nodfDYX9vVIASGAMmivJQ95aw4WETJwOW0M/NfH7y9RBWLLDUEognHZ80jWEx hxqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uvn8rG91KVV+1C8E5vq6QUp1dy2AFq5XyUIBPKg1+A0=; b=UXODjnj+u5f77DF9tVrtLqlaD21jvxg0La9PQnFX6dHW1AmQ7OatvyDrXx9IrKfgTv VOPNf3nJoGqZnflNxm2UW8xDFJcD7cr264f5XlMiQ0agz9B/JQDLAHLSyLv0o4AYf7ot uVuH9et2bDIyOosQ83oQhK1q6E6xFF8hMw7V7heg43V4q4Cmw3d5dvkufjV0fTwRrMlS htK/bsUq6TZbRuYuZjA+LX//9ve2j9iZrK9vaGvx97gocOmppp2liwphT5i/GjhGpnDW tp/stYHjK/Usacm1v708OgCZKxt6scHwGo9Ux2g8LgQp8Br+AHkZMLKgC4sINKgJT/Hk kGYw== X-Gm-Message-State: APjAAAUe5CciYQgbSG7MxLNM4lePPxF0WvayydOoBKG7JWljp8AXwhoc 6oD/Juepw3JPpBCWCmeCoZcEaQ6l X-Google-Smtp-Source: APXvYqwFDAKD79hQI7dqbBMJzuNhzxUPUtFpYlFLiPRrl3tTKgzel2gTjpy/3V+8N9PwZOOI7S+tMA== X-Received: by 2002:a7b:cb97:: with SMTP id m23mr2751348wmi.69.1574840967182; Tue, 26 Nov 2019 23:49:27 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc08e23.dynamic.kabel-deutschland.de. [188.192.142.35]) by smtp.gmail.com with ESMTPSA id n16sm4230831wro.88.2019.11.26.23.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 23:49:26 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 27 Nov 2019 08:48:57 +0100 Message-Id: <20191127074858.32066-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191106024922.19228-1-andreas.rheinhardt@gmail.com> References: <20191106024922.19228-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 28/29] avformat/matroskaenc: Add const where appropriate 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 6e1d575e3f..10599b11df 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -573,7 +573,8 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra return currentpos; } -static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par) +static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, + const AVCodecParameters *par) { const uint8_t *header_start[3]; int header_len[3]; @@ -601,7 +602,7 @@ static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecParame return 0; } -static int put_wv_codecpriv(AVIOContext *pb, AVCodecParameters *par) +static int put_wv_codecpriv(AVIOContext *pb, const AVCodecParameters *par) { if (par->extradata && par->extradata_size == 2) avio_write(pb, par->extradata, 2); @@ -611,7 +612,7 @@ static int put_wv_codecpriv(AVIOContext *pb, AVCodecParameters *par) } static int put_flac_codecpriv(AVFormatContext *s, - AVIOContext *pb, AVCodecParameters *par) + AVIOContext *pb, const AVCodecParameters *par) { int write_comment = (par->channel_layout && !(par->channel_layout & ~0x3ffffULL) && @@ -659,8 +660,9 @@ static int put_flac_codecpriv(AVFormatContext *s, return 0; } -static int get_aac_sample_rates(AVFormatContext *s, uint8_t *extradata, int extradata_size, - int *sample_rate, int *output_sample_rate) +static int get_aac_sample_rates(AVFormatContext *s, const uint8_t *extradata, + int extradata_size, int *sample_rate, + int *output_sample_rate) { MPEG4AudioConfig mp4ac; int ret; @@ -692,7 +694,7 @@ static int get_aac_sample_rates(AVFormatContext *s, uint8_t *extradata, int extr } static int mkv_write_native_codecprivate(AVFormatContext *s, AVIOContext *pb, - AVCodecParameters *par, + const AVCodecParameters *par, AVIOContext *dyn_cp) { switch (par->codec_id) { @@ -810,7 +812,9 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb, return ret; } -static int mkv_write_video_color(AVIOContext *pb, AVCodecParameters *par, AVStream *st) { +static int mkv_write_video_color(AVIOContext *pb, const AVCodecParameters *par, + const AVStream *st) +{ AVIOContext *dyn_cp; uint8_t *colorinfo_ptr; int side_data_size = 0; @@ -901,7 +905,7 @@ static int mkv_write_video_color(AVIOContext *pb, AVCodecParameters *par, AVStre } static int mkv_write_video_projection(AVFormatContext *s, AVIOContext *pb, - AVStream *st) + const AVStream *st) { ebml_master projection; int side_data_size = 0; @@ -1984,7 +1988,7 @@ fail: } static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, - uint32_t blockid, AVPacket *pkt, int keyframe) + uint32_t blockid, const AVPacket *pkt, int keyframe) { MatroskaMuxContext *mkv = s->priv_data; AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar; @@ -2090,7 +2094,7 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, } } -static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) +static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, const AVPacket *pkt) { MatroskaMuxContext *mkv = s->priv_data; mkv_track *track = &mkv->tracks[pkt->stream_index]; @@ -2147,7 +2151,7 @@ static void mkv_end_cluster(AVFormatContext *s) avio_flush(s->pb); } -static int mkv_check_new_extra_data(AVFormatContext *s, AVPacket *pkt) +static int mkv_check_new_extra_data(AVFormatContext *s, const AVPacket *pkt) { MatroskaMuxContext *mkv = s->priv_data; mkv_track *track = &mkv->tracks[pkt->stream_index]; @@ -2255,7 +2259,7 @@ static int mkv_check_new_extra_data(AVFormatContext *s, AVPacket *pkt) return 0; } -static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt) +static int mkv_write_packet_internal(AVFormatContext *s, const AVPacket *pkt) { MatroskaMuxContext *mkv = s->priv_data; AVIOContext *pb; @@ -2341,7 +2345,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return 0; } -static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) +static int mkv_write_packet(AVFormatContext *s, const AVPacket *pkt) { MatroskaMuxContext *mkv = s->priv_data; int codec_type = s->streams[pkt->stream_index]->codecpar->codec_type;