[FFmpeg-devel] [PATCH 3/4] ffserver_conf: factorize parse function per config tag

Lukasz Marek lukasz.m.luki2 at gmail.com
Tue Oct 21 22:56:45 CEST 2014


On 21.10.2014 20:25, Reimar Döffinger wrote:
> On 21.10.2014, at 12:15, Stefano Sabatini <stefasab at gmail.com> wrote:
>> On date Monday 2014-10-20 23:57:01 +0200, Lukasz Marek encoded:
>>> Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
>>> ---
>>> ffserver.c        |    6 +
>>> ffserver_config.c | 1138 ++++++++++++++++++++++++++---------------------------
>>> ffserver_config.h |    7 +
>>> 3 files changed, 566 insertions(+), 585 deletions(-)
>>>
>>> diff --git a/ffserver.c b/ffserver.c
>>> index af6e8e1..22560ce 100644
>>> --- a/ffserver.c
>>> +++ b/ffserver.c
>>> @@ -208,6 +208,12 @@ static FFServerConfig config = {
>>>      .logfilename = {0},
>>>      .http_addr = {0},
>>>      .rtsp_addr = {0},
>>> +    .errors = 0,
>>> +    .warnings = 0,
>>> +    .audio_id = AV_CODEC_ID_NONE,
>>> +    .video_id = AV_CODEC_ID_NONE,
>>> +    .audio_enc = {0},
>>> +    .video_enc = {0},
>>> };
>>
>> Probably good, also I like the idea to split the big parsing function.
>
> I was going to ask if it wouldn't me better to use memset or just a single {0} to ensure that the whole struct is initialized at least and then assign the values for which you want something else.
> Though since it is "static" variable all that is kind of pointless since it defaults to 0 initialization.
> I which case I'd prefer if all the explicit initialization 0 was removed, it feels like a lot of clutter to do effectively nothing.


Changed locally. Thx for that point.


More information about the ffmpeg-devel mailing list