diff mbox

[FFmpeg-devel] ffmpeg_opt: Silence a const warning

Message ID CAB0OVGq9DHZgJ5NGha22nqadUGnY8B2e57hoFwsgGNsmJjDksA@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Nov. 27, 2017, 11:07 p.m. UTC
Hi!

Attached patch fixes a warning:
fftools/ffmpeg_opt.c: In function ‘add_input_streams’:
fftools/ffmpeg_opt.c:804:29: warning: assignment discards ‘const’
qualifier from pointer target type

Please comment, Carl Eugen

Comments

Michael Niedermayer Nov. 28, 2017, 7:29 p.m. UTC | #1
On Tue, Nov 28, 2017 at 12:07:33AM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes a warning:
> fftools/ffmpeg_opt.c: In function ‘add_input_streams’:
> fftools/ffmpeg_opt.c:804:29: warning: assignment discards ‘const’
> qualifier from pointer target type
> 
> Please comment, Carl Eugen

>  ffmpeg_opt.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> f2101d38b3539e2f560eb7eb9dab1c9f722a5549  0001-ffmpeg_opt-Constify-hwaccel-pointer.patch
> From 5e1be030521a4253dc8385567ef359ef794f0820 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
> Date: Mon, 27 Nov 2017 23:54:33 +0100
> Subject: [PATCH] ffmpeg_opt: Constify hwaccel pointer.
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> Fixes a warning:
> fftools/ffmpeg_opt.c:804:29: warning: assignment discards ‘const’ qualifier from pointer target type

LGTM

thx

[...]
diff mbox

Patch

From 5e1be030521a4253dc8385567ef359ef794f0820 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 27 Nov 2017 23:54:33 +0100
Subject: [PATCH] ffmpeg_opt: Constify hwaccel pointer.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes a warning:
fftools/ffmpeg_opt.c:804:29: warning: assignment discards ‘const’ qualifier from pointer target type
---
 fftools/ffmpeg_opt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 9445a2d..0633ea7 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -702,7 +702,8 @@  static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
         AVStream *st = ic->streams[i];
         AVCodecParameters *par = st->codecpar;
         InputStream *ist = av_mallocz(sizeof(*ist));
-        char *framerate = NULL, *hwaccel = NULL, *hwaccel_device = NULL;
+        char *framerate = NULL, *hwaccel_device = NULL;
+        const char *hwaccel = NULL;
         char *hwaccel_output_format = NULL;
         char *codec_tag = NULL;
         char *next;
-- 
1.7.10.4