Commit 7e7dc148 authored by Clément Bœsch's avatar Clément Bœsch

lavfi/curves: make possible to customize presets.

parent a1e798ef
...@@ -2371,8 +2371,9 @@ The filter accepts the following options: ...@@ -2371,8 +2371,9 @@ The filter accepts the following options:
@table @option @table @option
@item preset @item preset
Select one of the available color presets. This option can not be used in Select one of the available color presets. This option can be used in addition
addition to the @option{r}, @option{g}, @option{b} parameters. to the @option{r}, @option{g}, @option{b} parameters; in this case, the later
options takes priority on the preset values.
Available presets are: Available presets are:
@table @samp @table @samp
@item none @item none
......
...@@ -333,14 +333,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args) ...@@ -333,14 +333,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
} }
if (curves->preset != PRESET_NONE) { if (curves->preset != PRESET_NONE) {
if (pts[0] || pts[1] || pts[2]) { if (!pts[0]) pts[0] = av_strdup(curves_presets[curves->preset].r);
av_log(ctx, AV_LOG_ERROR, "It is not possible to mix a preset " if (!pts[1]) pts[1] = av_strdup(curves_presets[curves->preset].g);
"with explicit points placements\n"); if (!pts[2]) pts[2] = av_strdup(curves_presets[curves->preset].b);
return AVERROR(EINVAL);
}
pts[0] = av_strdup(curves_presets[curves->preset].r);
pts[1] = av_strdup(curves_presets[curves->preset].g);
pts[2] = av_strdup(curves_presets[curves->preset].b);
if (!pts[0] || !pts[1] || !pts[2]) if (!pts[0] || !pts[1] || !pts[2])
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment