[FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for ticket 6658 (Dash demuxer segfault) - Add function 'resolve_content_path' to propagate the baseURL from upper level nodes. * if no baseURL is available, the path of mpd file will be set as the baseURL. - Remove che...

Moritz Barsnick barsnick at gmx.net
Mon Dec 25 14:04:22 EET 2017


On Sat, Dec 23, 2017 at 21:47:05 +0000, Colin NG wrote:

> Subject: [FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for ticket 6658 (Dash demuxer segfault) - Add function 'resolve_content_path' to propagate the baseURL from upper level 
>         nodes. * if no baseURL is available, the path of mpd file will be set as the baseURL. - Remove chec...                

In the commit message, you need to separate the subsequent lines from
the first line with an empty line, otherwise everything gets wrapped
into one subject line.

> +static int resolve_content_path(AVFormatContext *s, const char *url,  xmlNodePtr *baseurl_nodes,  int n_baseurl_nodes) {

ffmpeg functions have their opening bracket on the first column of a
new line.

> +    av_strlcpy (path, url, strlen(url) - size + 1);
[...]
> +    root_url = (av_strcasecmp(baseurl, ""))? baseurl: path;
[...]
> +    if (root_url[size-1]==token) {
> +        av_strlcat(root_url, "/", size+2);
> +        size+=2;

There are still quite a few style issues in your code. Have a look at
the ffmpeg contribution info for details:
https://ffmpeg.org/developer.html#Code-formatting-conventions

The operators "?" and ":" also need to be surrounded by whitespace, as
do "==", "+", "+=", and so on. On the other hand, the function name
such as av_strlcpy isn't separated by a space from its bracket.

> +            start = (text[0] == token) ? 1: 0;

start = (text[0] == token);
is sufficient.

Moritz


More information about the ffmpeg-devel mailing list