mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
lavfi/frei0r: add additional trailing slash in FREI0R_PATH paths
Allow to accept paths with no ending trailing slash. Based on a patch by rogerdpack <rogerpack2005@gmail.com>.
This commit is contained in:
parent
9a2028d4f4
commit
334a0d15c6
@ -230,9 +230,18 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
|
|||||||
const char *separator = ":";
|
const char *separator = ":";
|
||||||
#endif
|
#endif
|
||||||
char *p, *ptr = NULL;
|
char *p, *ptr = NULL;
|
||||||
for (p = path; p = av_strtok(p, separator, &ptr); p = NULL)
|
for (p = path; p = av_strtok(p, separator, &ptr); p = NULL) {
|
||||||
if (frei0r->dl_handle = load_path(ctx, p, dl_name))
|
/* add additional trailing slash in case it is missing */
|
||||||
|
char *p1 = av_asprintf("%s/", p);
|
||||||
|
if (!p1) {
|
||||||
|
av_free(path);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
frei0r->dl_handle = load_path(ctx, p1, dl_name);
|
||||||
|
av_free(p1);
|
||||||
|
if (frei0r->dl_handle)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
av_free(path);
|
av_free(path);
|
||||||
}
|
}
|
||||||
if (!frei0r->dl_handle && (path = getenv("HOME"))) {
|
if (!frei0r->dl_handle && (path = getenv("HOME"))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user