Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-12-15 17:50:09 +0400
committerStefano Sabatini <stefasab@gmail.com>2012-12-22 19:14:23 +0400
commitbde1e8bf069a31c86a6a2687a3df88b100302477 (patch)
tree4f27aae7534b8f7e2cf79e39bcb496c284bfd5a6 /libavfilter/vf_overlay.c
parent5e402a53191c8afad528ccd7d66f3c37b0cdb0af (diff)
lavfi/overlay: make use of av_opt_set_from_string()
Simplify.
Diffstat (limited to 'libavfilter/vf_overlay.c')
-rw-r--r--libavfilter/vf_overlay.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 4041901f89..b71ef41392 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -110,42 +110,19 @@ AVFILTER_DEFINE_CLASS(overlay);
static av_cold int init(AVFilterContext *ctx, const char *args)
{
OverlayContext *over = ctx->priv;
- char *args1 = av_strdup(args);
- char *expr, *bufptr = NULL;
- int ret = 0;
+ static const char *shorthand[] = { "x", "y", NULL };
over->class = &overlay_class;
av_opt_set_defaults(over);
- if (expr = av_strtok(args1, ":", &bufptr)) {
- av_free(over->x_expr);
- if (!(over->x_expr = av_strdup(expr))) {
- ret = AVERROR(ENOMEM);
- goto end;
- }
- }
- if (expr = av_strtok(NULL, ":", &bufptr)) {
- av_free(over->y_expr);
- if (!(over->y_expr = av_strdup(expr))) {
- ret = AVERROR(ENOMEM);
- goto end;
- }
- }
-
- if (bufptr && (ret = av_set_options_string(over, bufptr, "=", ":")) < 0)
- goto end;
-
-end:
- av_free(args1);
- return ret;
+ return av_opt_set_from_string(over, args, shorthand, "=", ":");
}
static av_cold void uninit(AVFilterContext *ctx)
{
OverlayContext *over = ctx->priv;
- av_freep(&over->x_expr);
- av_freep(&over->y_expr);
+ av_opt_free(over);
avfilter_unref_bufferp(&over->overpicref);
ff_bufqueue_discard_all(&over->queue_main);