[FFmpeg-devel] [PATCH]lavf:Constify AVInputFormat pointer

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Jan 30 22:50:35 EET 2019


2019-01-30 17:03 GMT+01:00, James Almer <jamrial at gmail.com>:
> On 1/30/2019 12:33 PM, Michael Niedermayer wrote:
>> On Sun, Jan 27, 2019 at 10:38:13PM +0100, Carl Eugen Hoyos wrote:

>>> Attached patch was requested in ticket #7220 iiuc.
>>>
>>> Please review, Carl Eugen
>>
>>>  avformat.h |    8 ++++----
>>>  format.c   |    4 ++--
>>>  hls.c      |    2 +-
>>>  utils.c    |    4 ++--
>>>  4 files changed, 9 insertions(+), 9 deletions(-)
>>> 0a59a10c224ba092d8b7b61e3cac78a93c23bee2
>>> 0001-lavf-Constify-AVInputFormat-pointer.patch
>>> From a713b58767e8d77b641d1b87e68de11c176fd454 Mon Sep 17 00:00:00 2001
>>> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
>>> Date: Sun, 27 Jan 2019 22:35:51 +0100
>>> Subject: [PATCH] lavf: Constify AVInputFormat pointer.
>>
>> there is some tiny chance this could break some user apps
>> build i think so if done strictly correct it would need to be
>> delayed to the next bump i think

Yes, it unfortunately breaks C++ compilation:
#define __STDC_CONSTANT_MACROS
#include "libavformat/avformat.h"
int main()
{
/*const*/ AVInputFormat **dummy = NULL;
return av_probe_input_buffer2(NULL, dummy, NULL, NULL, 0, 0);
}

> We have tied constifying (or the opposite) to major bumps before,
> so i agree.

It depended on the placement of const, I believe this patch did not
break anything:
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=f2c86705

Will try to create a new patch with a version dependency, Carl Eugen


More information about the ffmpeg-devel mailing list