[FFmpeg-devel] [PATCH 5/6] avformat/argo_asf: add name option

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat Aug 8 16:01:42 EEST 2020


Zane van Iperen:
> On Sat, 8 Aug 2020 12:20:32 +0200
> "Andreas Rheinhardt" <andreas.rheinhardt at gmail.com> wrote:
> 
>>>  #if CONFIG_ARGO_ASF_DEMUXER
>>> @@ -301,7 +302,10 @@ static int argo_asf_write_header(AVFormatContext *s)
>>>      /* version_{major,minor} set by options. */
>>>      ctx->fhdr.num_chunks         = 1;
>>>      ctx->fhdr.chunk_offset       = ASF_FILE_HEADER_SIZE;
>>> -    strncpy(ctx->fhdr.name, av_basename(s->url), FF_ARRAY_ELEMS(ctx->fhdr.name));
>>> +    if (ctx->name)
>>> +        strncpy(ctx->fhdr.name, ctx->name, FF_ARRAY_ELEMS(ctx->fhdr.name));
>>> +    else
>>> +        strncpy(ctx->fhdr.name, av_basename(s->url), FF_ARRAY_ELEMS(ctx->fhdr.name));
>>
>> FF_ARRAY_ELEMS() is actually inappropriate here: Use sizeof() directly.
> Fixed.
> 
>> No need to make a separate patch for it.
> Do you mean squash it into the previous one where I add the version
> options?
> 
No, I mean that you don't need to make a separate patch that only
changes FF_ARRAY_ELEMS to sizeof. You can directly change it in this
patch here.

- Andreas


More information about the ffmpeg-devel mailing list