summaryrefslogtreecommitdiff
path: root/libavfilter/vf_colorspace.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2016-10-24 16:03:16 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2016-10-24 16:03:16 -0400
commitf141ac4d0bf1a05c77949edc9d679295fcc79f5f (patch)
tree08651c1e8fa2934b2bf1b71739bb1cc21e72ae0d /libavfilter/vf_colorspace.c
parentbe885da3427c5d9a6fa68229d16318afffe67193 (diff)
vf_colorspace: don't spam console with warnings if range is unspecified.
Diffstat (limited to 'libavfilter/vf_colorspace.c')
-rw-r--r--libavfilter/vf_colorspace.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 5b060f9127..45b96c07e3 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -163,6 +163,8 @@ typedef struct ColorSpaceContext {
yuv2yuv_fn yuv2yuv;
double yuv2rgb_dbl_coeffs[3][3], rgb2yuv_dbl_coeffs[3][3];
int in_y_rng, in_uv_rng, out_y_rng, out_uv_rng;
+
+ int did_warn_range;
} ColorSpaceContext;
// FIXME deal with odd width/heights (or just forbid it)
@@ -523,8 +525,14 @@ static int get_range_off(AVFilterContext *ctx, int *off,
enum AVColorRange rng, int depth)
{
switch (rng) {
- case AVCOL_RANGE_UNSPECIFIED:
- av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");
+ case AVCOL_RANGE_UNSPECIFIED: {
+ ColorSpaceContext *s = ctx->priv;
+
+ if (!s->did_warn_range) {
+ av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");
+ s->did_warn_range = 1;
+ }
+ }
// fall-through
case AVCOL_RANGE_MPEG:
*off = 16 << (depth - 8);