Commit f141ac4d authored by Ronald S. Bultje's avatar Ronald S. Bultje

vf_colorspace: don't spam console with warnings if range is unspecified.

parent be885da3
...@@ -163,6 +163,8 @@ typedef struct ColorSpaceContext { ...@@ -163,6 +163,8 @@ typedef struct ColorSpaceContext {
yuv2yuv_fn yuv2yuv; yuv2yuv_fn yuv2yuv;
double yuv2rgb_dbl_coeffs[3][3], rgb2yuv_dbl_coeffs[3][3]; 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 in_y_rng, in_uv_rng, out_y_rng, out_uv_rng;
int did_warn_range;
} ColorSpaceContext; } ColorSpaceContext;
// FIXME deal with odd width/heights (or just forbid it) // FIXME deal with odd width/heights (or just forbid it)
...@@ -523,8 +525,14 @@ static int get_range_off(AVFilterContext *ctx, int *off, ...@@ -523,8 +525,14 @@ static int get_range_off(AVFilterContext *ctx, int *off,
enum AVColorRange rng, int depth) enum AVColorRange rng, int depth)
{ {
switch (rng) { switch (rng) {
case AVCOL_RANGE_UNSPECIFIED: 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"); av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");
s->did_warn_range = 1;
}
}
// fall-through // fall-through
case AVCOL_RANGE_MPEG: case AVCOL_RANGE_MPEG:
*off = 16 << (depth - 8); *off = 16 << (depth - 8);
......
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