From patchwork Thu Oct 20 16:06:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ronald S. Bultje" X-Patchwork-Id: 1089 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp712322vsd; Thu, 20 Oct 2016 09:24:08 -0700 (PDT) X-Received: by 10.194.84.144 with SMTP id z16mr887876wjy.210.1476980648484; Thu, 20 Oct 2016 09:24:08 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r7si62328843wjr.112.2016.10.20.09.24.07; Thu, 20 Oct 2016 09:24:08 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 40451689C0E; Thu, 20 Oct 2016 19:24:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA2AA689216 for ; Thu, 20 Oct 2016 19:23:55 +0300 (EEST) Received: by mail-qk0-f196.google.com with SMTP id z190so4955553qkc.3 for ; Thu, 20 Oct 2016 09:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gVvqysBSGWv/EtbbtpZ+tvyW4RgrEXwfmpSV+YTd3yk=; b=Anm8ri2t07iijNauDMraERnM1r5ymB1HxuyU82WKolVKgg1ei/WnaDPxMENt4O7HvP kgDUwiNIpTo5gWmZ4Je/I3uGmbuAQgDCEYV95qs0NL5xKMT0QUS4ac6qLa1dZ9dDAaRQ 7jhJaoQXxBwh6s3V95UWV84+jIX+eMtBJOzOc+/JAQZKI7yjLywqCyFZBvqR0jc2HZiX haTt1a7rH2xcfoEB9Uoh16EaLEENc1JlLltFgKip6DPsnjeAnBm4jr0sXakm+v9vHrLj xS/HuEAEnPzTTkrzfZBy6i18rAhAm0g1WfzYjZjEzh3lGu2Ba2Yfwsklb0Ie4cwHdhjr BFGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gVvqysBSGWv/EtbbtpZ+tvyW4RgrEXwfmpSV+YTd3yk=; b=QLabeB+PNzSZWjSTLURnG8zX4xzHqhMcSzmKsGWs5JBKdW6w/hnnj+N37L7M7AagC3 mzuM/kEUfIJzKduA1cJ0IyECuGKbfE3x5YDH4a7OtM3N/4xycSUZl/qBd9blVVr6vBp0 55sV5AO4bDQsQ1gRGpg7Af6/EpFLMbBhT0Jy/9dH6fhf27opiP3LAKG2FKld0btJ5Nx7 CI7pnc/MAFjZJmGLY8svKnkf2pNy4DO49FbMxk8Ffe7n6wKQwV9oSnl234SIGE5XQN6Y AxUXdI4JF0M6vaWCMS6Tp9voEeDTBRs7PoP7ybmJQECHFnimXEK1FMgl4AtxpV2HxB2p 9A4w== X-Gm-Message-State: ABUngvcAazcLuvLY48o3hIttiLB36QsH2GmZ5QxqwP1xrTnj1KBBrJXQ8kytOlLZwxmRLQ== X-Received: by 10.55.145.129 with SMTP id t123mr1199941qkd.130.1476979577524; Thu, 20 Oct 2016 09:06:17 -0700 (PDT) Received: from Macintosh-7.local.com ([65.206.95.146]) by smtp.gmail.com with ESMTPSA id v41sm23868038qta.29.2016.10.20.09.06.16 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 20 Oct 2016 09:06:16 -0700 (PDT) From: "Ronald S. Bultje" To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Oct 2016 12:06:14 -0400 Message-Id: <1476979574-53380-1-git-send-email-rsbultje@gmail.com> X-Mailer: git-send-email 2.8.1 Subject: [FFmpeg-devel] [PATCH] vf_colorspace: don't spam console with warnings if range is unspecified. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: "Ronald S. Bultje" MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavfilter/vf_colorspace.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c index c74fe00..f64163f 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_range_warn; } ColorSpaceContext; // FIXME deal with odd width/heights (or just forbid it) @@ -523,9 +525,15 @@ 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_range_warn) { + av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n"); + s->did_range_warn = 1; + } // fall-through + } case AVCOL_RANGE_MPEG: *off = 16 << (depth - 8); *y_rng = 219 << (depth - 8);