[FFmpeg-cvslog] lavfi/curves: make possible to customize presets.
Clément Bœsch
git at videolan.org
Thu Apr 11 13:07:26 CEST 2013
ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Apr 11 12:47:42 2013 +0200| [7e7dc1489f5e7b3810935f17ec3c9a7ca2beb68a] | committer: Clément Bœsch
lavfi/curves: make possible to customize presets.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e7dc1489f5e7b3810935f17ec3c9a7ca2beb68a
---
doc/filters.texi | 5 +++--
libavfilter/vf_curves.c | 11 +++--------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/doc/filters.texi b/doc/filters.texi
index 3d40b4f..04f75c1 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -2371,8 +2371,9 @@ The filter accepts the following options:
@table @option
@item preset
-Select one of the available color presets. This option can not be used in
-addition to the @option{r}, @option{g}, @option{b} parameters.
+Select one of the available color presets. This option can be used in addition
+to the @option{r}, @option{g}, @option{b} parameters; in this case, the later
+options takes priority on the preset values.
Available presets are:
@table @samp
@item none
diff --git a/libavfilter/vf_curves.c b/libavfilter/vf_curves.c
index d0a8ebc..378754d 100644
--- a/libavfilter/vf_curves.c
+++ b/libavfilter/vf_curves.c
@@ -333,14 +333,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
}
if (curves->preset != PRESET_NONE) {
- if (pts[0] || pts[1] || pts[2]) {
- av_log(ctx, AV_LOG_ERROR, "It is not possible to mix a preset "
- "with explicit points placements\n");
- 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[0] = av_strdup(curves_presets[curves->preset].r);
+ if (!pts[1]) pts[1] = av_strdup(curves_presets[curves->preset].g);
+ if (!pts[2]) pts[2] = av_strdup(curves_presets[curves->preset].b);
if (!pts[0] || !pts[1] || !pts[2])
return AVERROR(ENOMEM);
}
More information about the ffmpeg-cvslog
mailing list