summaryrefslogtreecommitdiff
path: root/libavfilter/vf_frei0r.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2014-02-27 12:29:37 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-03-04 11:39:02 +0100
commit61b323ce7c7cdc101eadfd7de2203922b8a39e8d (patch)
tree383a0ceba854cbd67542e9b89ed88df086d82f93 /libavfilter/vf_frei0r.c
parent4e0be9c86f2003dd3ba2eb8fad01e8d0e538075e (diff)
vf_frei0r: refactor library loading from env variable
strtok_r is not needed any more, so remove it from configure.
Diffstat (limited to 'libavfilter/vf_frei0r.c')
-rw-r--r--libavfilter/vf_frei0r.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index fde6e1a96c..c9699677c8 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -232,12 +232,18 @@ static av_cold int frei0r_init(AVFilterContext *ctx,
}
/* see: http://piksel.org/frei0r/1.2/spec/1.2/spec/group__pluglocations.html */
- if ((path = av_strdup(getenv("FREI0R_PATH")))) {
- char *p, *ptr = NULL;
- for (p = path; p = strtok_r(p, ":", &ptr); p = NULL)
- if (s->dl_handle = load_path(ctx, p, dl_name))
- break;
- av_free(path);
+ if (path = getenv("FREI0R_PATH")) {
+ while(*path) {
+ char *ptr = av_get_token((const char **)&path, ":");
+ if (!ptr)
+ return AVERROR(ENOMEM);
+ s->dl_handle = load_path(ctx, ptr, dl_name);
+ av_freep(&ptr);
+ if (s->dl_handle)
+ break; /* found */
+ if (*path)
+ path++ /* skip ':' */
+ }
}
if (!s->dl_handle && (path = getenv("HOME"))) {
char prefix[1024];