From patchwork Sun Feb 26 11:38:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 2685 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp578162vsf; Sun, 26 Feb 2017 03:38:35 -0800 (PST) X-Received: by 10.28.225.132 with SMTP id y126mr8977806wmg.127.1488109115563; Sun, 26 Feb 2017 03:38:35 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y103si17536259wrb.312.2017.02.26.03.38.35; Sun, 26 Feb 2017 03:38:35 -0800 (PST) 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; 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 9DFCB688247; Sun, 26 Feb 2017 13:38:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 409AD680AB0 for ; Sun, 26 Feb 2017 13:38:17 +0200 (EET) Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1chx9l-0003NC-Os for ffmpeg-devel@ffmpeg.org; Sun, 26 Feb 2017 12:38:25 +0100 Received: from [192.168.1.3] ([80.110.113.30]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id pPeF1u0080fQb4o01PeGGm; Sun, 26 Feb 2017 12:38:16 +0100 X-SourceIP: 80.110.113.30 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Sun, 26 Feb 2017 12:38:14 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201702261238.14979.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavc/internal: Constify AVPacket* in AVCodecInternal. 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 fixes another warning when compiling libavcodec/utils.o. Please comment, Carl Eugen From 1a77bc829eb2a906e175f296821ee7f91f19724a Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 26 Feb 2017 12:34:41 +0100 Subject: [PATCH] lavc/internal: Constify AVPacket* in AVCodecInternal. Fixes a gcc warning: libavcodec/utils.c:2244:26: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] --- libavcodec/internal.h | 2 +- libavcodec/utils.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/internal.h b/libavcodec/internal.h index c92dba4..cbbbb6c 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -141,7 +141,7 @@ typedef struct AVCodecInternal { * Current packet as passed into the decoder, to avoid having to pass the * packet into every function. */ - AVPacket *pkt; + const AVPacket *pkt; /** * temporary buffer used for encoders to store their bitstream diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1156e43..e0d4b04 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -745,7 +745,7 @@ int avcodec_default_get_buffer2(AVCodecContext *avctx, AVFrame *frame, int flags } } -static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame) +static int add_metadata_from_side_data(const AVPacket *avpkt, AVFrame *frame) { int size; const uint8_t *side_metadata; @@ -759,7 +759,7 @@ static int add_metadata_from_side_data(AVPacket *avpkt, AVFrame *frame) int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame) { - AVPacket *pkt = avctx->internal->pkt; + const AVPacket *pkt = avctx->internal->pkt; int i; static const struct { enum AVPacketSideDataType packet;