Message ID | DM5PR22MB0681B5FC1678802A136FF8A7FE030@DM5PR22MB0681.namprd22.prod.outlook.com |
---|---|
State | New |
Headers | show |
On Sat, Dec 23, 2017 at 09:47:05PM +0000, Colin NG wrote: > --- > libavformat/dashdec.c | 110 ++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 97 insertions(+), 13 deletions(-) seems my git doesnt like this patch: Applying: 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... error: corrupt patch at line 20 error: could not build fake ancestor Patch failed at 0001 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... The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". [...]
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
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 3798649..6574e56 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -148,6 +148,11 @@ static uint64_t get_current_time_in_sec(void) return av_gettime() / 1000000; } +static int ishttp(char *url) { + const char *proto_name = avio_find_protocol_name(url); + return av_strstart(proto_name, "http", NULL); +} static uint64_t get_utc_date_time_insec(AVFormatContext *s, const char *datetime) { struct tm timeinfo; @@ -392,7 +397,9 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,