aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2011-10-15 00:14:37 +0200
committerStefano Sabatini <stefasab@gmail.com>2011-10-18 18:21:03 +0200
commitb35e9e19e93b0c69303444e9974ee640a924f798 (patch)
tree09c93cf03ae3e1902b312eef74aab72f75180da9 /libavfilter
parent88bdf7471f6b8df5106f84b4b4d4cffe4606bcb0 (diff)
downloadffmpeg-b35e9e19e93b0c69303444e9974ee640a924f798.tar.gz
lavu: add av_strtok()
The function strtok_r() is part of the POSIX.1 specification, but is not available on some platforms. We provide an internal implementation, so we do not need to rely on a platform implementation.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_aconvert.c7
-rw-r--r--libavfilter/af_aformat.c2
-rw-r--r--libavfilter/asrc_abuffer.c5
-rw-r--r--libavfilter/vf_frei0r.c2
4 files changed, 9 insertions, 7 deletions
diff --git a/libavfilter/af_aconvert.c b/libavfilter/af_aconvert.c
index d794c23576..fef096cb8e 100644
--- a/libavfilter/af_aconvert.c
+++ b/libavfilter/af_aconvert.c
@@ -28,6 +28,7 @@
*/
#include "libavutil/audioconvert.h"
+#include "libavutil/avstring.h"
#include "libavcodec/audioconvert.h"
#include "avfilter.h"
#include "internal.h"
@@ -125,15 +126,15 @@ static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque)
aconvert->out_chlayout = 0;
aconvert->out_packing_fmt = -1;
- if ((arg = strtok_r(args, ":", &ptr)) && strcmp(arg, "auto")) {
+ if ((arg = av_strtok(args, ":", &ptr)) && strcmp(arg, "auto")) {
if ((ret = ff_parse_sample_format(&aconvert->out_sample_fmt, arg, ctx)) < 0)
goto end;
}
- if ((arg = strtok_r(NULL, ":", &ptr)) && strcmp(arg, "auto")) {
+ if ((arg = av_strtok(NULL, ":", &ptr)) && strcmp(arg, "auto")) {
if ((ret = ff_parse_channel_layout(&aconvert->out_chlayout, arg, ctx)) < 0)
goto end;
}
- if ((arg = strtok_r(NULL, ":", &ptr)) && strcmp(arg, "auto")) {
+ if ((arg = av_strtok(NULL, ":", &ptr)) && strcmp(arg, "auto")) {
if ((ret = ff_parse_packing_format((int *)&aconvert->out_packing_fmt, arg, ctx)) < 0)
goto end;
}
diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
index a7aa45f0b1..20ab940cc8 100644
--- a/libavfilter/af_aformat.c
+++ b/libavfilter/af_aformat.c
@@ -50,7 +50,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
aformat->fmts_list = all_formats; \
} else { \
for (fmt_str = fmts_str; \
- fmt_str = strtok_r(fmt_str, ",", &ptr); fmt_str = NULL) { \
+ fmt_str = av_strtok(fmt_str, ",", &ptr); fmt_str = NULL) { \
if ((ret = ff_parse_##fmt_name((fmt_type *)&fmt, \
fmt_str, ctx)) < 0) { \
av_freep(&fmts_str); \
diff --git a/libavfilter/asrc_abuffer.c b/libavfilter/asrc_abuffer.c
index 4a0f08e538..bfa7e63f2a 100644
--- a/libavfilter/asrc_abuffer.c
+++ b/libavfilter/asrc_abuffer.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/audioconvert.h"
+#include "libavutil/avstring.h"
#include "libavutil/fifo.h"
#include "asrc_abuffer.h"
#include "internal.h"
@@ -256,7 +257,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque)
char *args = av_strdup(args0);
int ret;
- arg = strtok_r(args, ":", &ptr);
+ arg = av_strtok(args, ":", &ptr);
#define ADD_FORMAT(fmt_name) \
if (!arg) \
@@ -266,7 +267,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args0, void *opaque)
return ret; \
} \
if (*args) \
- arg = strtok_r(NULL, ":", &ptr)
+ arg = av_strtok(NULL, ":", &ptr)
ADD_FORMAT(sample_rate);
ADD_FORMAT(sample_format);
diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c
index f5b7abb543..5d5a4db1e6 100644
--- a/libavfilter/vf_frei0r.c
+++ b/libavfilter/vf_frei0r.c
@@ -216,7 +216,7 @@ 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)
+ for (p = path; p = av_strtok(p, ":", &ptr); p = NULL)
if (frei0r->dl_handle = load_path(ctx, p, dl_name))
break;
av_free(path);