... | ... |
@@ -72,34 +72,34 @@ static av_cold int init(AVFilterContext *ctx, const char *args) |
72 | 72 |
hue->class = &hue_class; |
73 | 73 |
av_opt_set_defaults(hue); |
74 | 74 |
|
75 |
- /* named options syntax */ |
|
76 | 75 |
if (args) { |
77 |
- if (equal = strchr(args, '=')) { |
|
78 |
- if ((ret = av_set_options_string(hue, args, "=", ":")) < 0) |
|
79 |
- return ret; |
|
80 |
- if (hue->hue != -FLT_MAX && hue->hue_deg != -FLT_MAX) { |
|
81 |
- av_log(ctx, AV_LOG_ERROR, |
|
82 |
- "H and h options are incompatible and cannot be specified " |
|
83 |
- "at the same time\n"); |
|
84 |
- return AVERROR(EINVAL); |
|
76 |
+ /* named options syntax */ |
|
77 |
+ if (equal = strchr(args, '=')) { |
|
78 |
+ if ((ret = av_set_options_string(hue, args, "=", ":")) < 0) |
|
79 |
+ return ret; |
|
80 |
+ if (hue->hue != -FLT_MAX && hue->hue_deg != -FLT_MAX) { |
|
81 |
+ av_log(ctx, AV_LOG_ERROR, |
|
82 |
+ "H and h options are incompatible and cannot be specified " |
|
83 |
+ "at the same time\n"); |
|
84 |
+ return AVERROR(EINVAL); |
|
85 |
+ } |
|
86 |
+ /* compatibility h:s syntax */ |
|
87 |
+ } else { |
|
88 |
+ n = sscanf(args, "%f%c%f%c", &hue->hue_deg, &c1, &hue->saturation, &c2); |
|
89 |
+ if (n != 1 && (n != 3 || c1 != ':')) { |
|
90 |
+ av_log(ctx, AV_LOG_ERROR, |
|
91 |
+ "Invalid syntax for argument '%s': " |
|
92 |
+ "must be in the form 'hue[:saturation]'\n", args); |
|
93 |
+ return AVERROR(EINVAL); |
|
94 |
+ } |
|
95 |
+ |
|
96 |
+ if (hue->saturation < -10 || hue->saturation > 10) { |
|
97 |
+ av_log(ctx, AV_LOG_ERROR, |
|
98 |
+ "Invalid value for saturation %0.1f: " |
|
99 |
+ "must be included between range -10 and +10\n", hue->saturation); |
|
100 |
+ return AVERROR(EINVAL); |
|
101 |
+ } |
|
85 | 102 |
} |
86 |
- /* compatibility syntax */ |
|
87 |
- } else { |
|
88 |
- n = sscanf(args, "%f%c%f%c", &hue->hue_deg, &c1, &hue->saturation, &c2); |
|
89 |
- if (n != 1 && (n != 3 || c1 != ':')) { |
|
90 |
- av_log(ctx, AV_LOG_ERROR, |
|
91 |
- "Invalid syntax for argument '%s': " |
|
92 |
- "must be in the form 'hue[:saturation]'\n", args); |
|
93 |
- return AVERROR(EINVAL); |
|
94 |
- } |
|
95 |
- |
|
96 |
- if (hue->saturation < -10 || hue->saturation > 10) { |
|
97 |
- av_log(ctx, AV_LOG_ERROR, |
|
98 |
- "Invalid value for saturation %0.1f: " |
|
99 |
- "must be included between range -10 and +10\n", hue->saturation); |
|
100 |
- return AVERROR(EINVAL); |
|
101 |
- } |
|
102 |
- } |
|
103 | 103 |
} |
104 | 104 |
|
105 | 105 |
if (hue->saturation == -FLT_MAX) |